Skip to content
New issue

Have a question about this project? Sign up for a free GitHub account to open an issue and contact its maintainers and the community.

By clicking “Sign up for GitHub”, you agree to our terms of service and privacy statement. We’ll occasionally send you account related emails.

Already on GitHub? Sign in to your account

Scala 3 and updates #3

Merged
merged 18 commits into from
Oct 4, 2024
Merged
Show file tree
Hide file tree
Changes from all commits
Commits
File filter

Filter by extension

Filter by extension


Conversations
Failed to load comments.
Loading
Jump to
Jump to file
Failed to load files.
Loading
Diff view
Diff view
52 changes: 52 additions & 0 deletions .github/workflows/ci.yml
Original file line number Diff line number Diff line change
@@ -0,0 +1,52 @@
name: CI build

on:
push:
branches: [ master ]
tags: [ '*' ]
pull_request:
branches: [ master ]
types: [ opened, reopened, labeled, synchronize ]

jobs:
check-formatting:

runs-on: ubuntu-latest
if: github.event_name == 'push' || github.event.action != 'labeled' # run for 'opened', 'reopened' and 'synchronize'

steps:
- uses: actions/checkout@v3
with:
fetch-depth: 0
- uses: coursier/setup-action@v1.3.0
with:
apps: scalafmt
- name: Check code and docs formatting
run: scalafmt --check

build:

runs-on: ubuntu-latest
if: github.event_name == 'push' || github.event.action != 'labeled' # run for 'opened', 'reopened' and 'synchronize'

strategy:
matrix:
scala: ["2_12", "2_13", "3"]
platform: ["jvm", "js", "native"]
jvm: ['temurin:1.8.0-392', 'temurin:1.21.0.1']
fail-fast: false

steps:
- uses: actions/checkout@v3
with:
fetch-depth: 0
- uses: coursier/cache-action@v6
- uses: coursier/setup-action@v1.3.0
with:
jvm: ${{ matrix.jvm }}
apps: sbt
- name: Clean, compile, test, generate coverage report, check MiMa
run: sbt ci-${{ matrix.platform }}-${{ matrix.scala }}
- uses: codecov/codecov-action@v3
with:
token: ${{ secrets.CODECOV_TOKEN }}
13 changes: 13 additions & 0 deletions .github/workflows/dependency-graph.yml
Original file line number Diff line number Diff line change
@@ -0,0 +1,13 @@
name: Update Dependency Graph

on:
push:
branches: [ master ]

jobs:
dependency-graph:
name: Update Dependency Graph
runs-on: ubuntu-latest
steps:
- uses: actions/checkout@v3
- uses: scalacenter/sbt-dependency-submission@v2
30 changes: 30 additions & 0 deletions .github/workflows/release.yml
Original file line number Diff line number Diff line change
@@ -0,0 +1,30 @@
name: Sonatype Release

on:
push:
branches: [ master ]
tags: [ '*' ]

jobs:
release-tag:
runs-on: ubuntu-latest

steps:
- uses: actions/checkout@v3
with:
fetch-depth: 0
- uses: coursier/cache-action@v6
- name: Import GPG key for signing the release
uses: crazy-max/ghaction-import-gpg@v6
with:
gpg_private_key: ${{ secrets.GPG_PRIVATE_KEY }}
passphrase: ${{ secrets.GPG_PASSPHRASE }}
- uses: coursier/setup-action@v1.3.0
with:
jvm: 'temurin:1.8.0-392'
apps: sbt
- name: Publish all projects
run: sbt ci-release
env:
SONATYPE_USERNAME: ${{ secrets.SONATYPE_USERNAME }}
SONATYPE_PASSWORD: ${{ secrets.SONATYPE_PASSWORD }}
20 changes: 16 additions & 4 deletions .gitignore
Original file line number Diff line number Diff line change
@@ -1,6 +1,18 @@
# sbt build
project/project
project/target
target
*.class
# Mdocs documentation
docs/build
# Scala Metals and BSP
.bloop
.ensime
.bsp
.metals
project/metals.sbt
# IDEs
.idea
target/
project/target
*~
.vscode
# other
.scala-build
*.log
21 changes: 21 additions & 0 deletions .readthedocs.yaml
Original file line number Diff line number Diff line change
@@ -0,0 +1,21 @@
# .readthedocs.yaml
# Read the Docs configuration file
# See https://docs.readthedocs.io/en/stable/config-file/v2.html for details

# Required
version: 2

build:
os: ubuntu-22.04
tools:
python: "3.11"
jobs:
post_checkout:
- git fetch --unshallow || true

python:
install:
- requirements: docs/requirements.txt

mkdocs:
configuration: docs/mkdocs.yml
43 changes: 22 additions & 21 deletions .scalafmt.conf
Original file line number Diff line number Diff line change
@@ -1,24 +1,25 @@
version = 3.8.2
project.git = true
project.includePaths."+" = ["glob:**/docs/**.md"]
maxColumn = 120
style = IntelliJ
align = most
align.openParenCallSite = true
align.tokens.add = ["=",":"]
assumeStandardLibraryStripMargin = true
newlines.sometimesBeforeColonInMethodReturnType = false
optIn.breakChainOnFirstMethodDot = false
optIn.configStyleArguments = true
runner.optimizer.forceConfigStyleOnOffset = 120
runner.optimizer.forceConfigStyleMinArgCount = 1
spaces.inImportCurlyBraces = true
runner.dialect = Scala213Source3
fileOverride {
"glob:**/src/main/scala-3/**" { runner.dialect = scala3 }
"glob:**/src/test/scala-3/**" { runner.dialect = scala3 }
}

rewrite.rules = [
PreferCurlyFors,
RedundantBraces,
RedundantParens,
SortImports
]
align.preset = some

project.git = true
project.includeFilters = [
"modules/.+\\.scala"
]
rewrite.rules = [Imports, RedundantBraces, SortModifiers]
rewrite.imports.sort = scalastyle
rewrite.redundantBraces.stringInterpolation = true

rewrite.scala3.convertToNewSyntax = true
rewrite.scala3.removeOptionalBraces = false

docstrings.blankFirstLine = no
docstrings.style = SpaceAsterisk
docstrings.wrap = yes

newlines.sometimesBeforeColonInMethodReturnType = true
lineEndings = unix
48 changes: 0 additions & 48 deletions .tmuxinator.yml

This file was deleted.

24 changes: 0 additions & 24 deletions .travis.yml

This file was deleted.

4 changes: 2 additions & 2 deletions README.md
Original file line number Diff line number Diff line change
Expand Up @@ -7,7 +7,7 @@

One enum type class to rule them all.

In Scala you might meet many different implementations of enums:
In Scala, you might meet many different implementations of enums:

* build-in `scala.Enumeration`,
* sum-type based sealed hierarchies,
Expand All @@ -22,7 +22,7 @@ With a type class.

## Usage

Add to your sbt (2.11, 2.12 and 2.13 supported)
Add to your sbt (2.12, 2.13 and 3.3+ supported)

```scala
libraryDependencies += "io.scalaland" %% "enumz" % enumzVersion // see Maven badge
Expand Down
Loading
Loading