Skip to content

Commit 9890718

Browse files
guizmaiiCopilot
andauthored
Modernize (#1)
* Modernize * Modernize * Modernize * Apply suggestion from @Copilot Co-authored-by: Copilot <175728472+Copilot@users.noreply.github.com> Signed-off-by: Jules Ivanic <jules.ivanic@gmail.com> * Modernize --------- Signed-off-by: Jules Ivanic <jules.ivanic@gmail.com> Co-authored-by: Copilot <175728472+Copilot@users.noreply.github.com>
1 parent b85c576 commit 9890718

19 files changed

Lines changed: 392 additions & 145 deletions

File tree

.github/dependabot.yml

Lines changed: 6 additions & 0 deletions
Original file line numberDiff line numberDiff line change
@@ -0,0 +1,6 @@
1+
version: 2
2+
updates:
3+
- package-ecosystem: "github-actions"
4+
directory: "/"
5+
schedule:
6+
interval: "weekly"

.github/release-drafter.yml

Lines changed: 59 additions & 0 deletions
Original file line numberDiff line numberDiff line change
@@ -0,0 +1,59 @@
1+
name-template: '$RESOLVED_VERSION'
2+
tag-template: '$RESOLVED_VERSION'
3+
4+
version-resolver:
5+
major:
6+
labels:
7+
- 'major'
8+
minor:
9+
labels:
10+
- 'minor'
11+
patch:
12+
labels:
13+
- 'patch'
14+
default: minor
15+
16+
categories:
17+
- title: 'Features'
18+
label: 'enhancement'
19+
- title: 'Bug Fixes'
20+
label: 'bug'
21+
22+
exclude-labels:
23+
- 'skip'
24+
25+
autolabeler:
26+
- label: 'bug'
27+
title:
28+
- '/.*\[fix\].*/'
29+
- label: 'patch'
30+
title:
31+
- '/.*\[fix\].*/'
32+
- label: 'enhancement'
33+
title:
34+
- '/.*\[feat\].*/'
35+
- label: 'minor'
36+
title:
37+
- '/.*\[feat\].*/'
38+
- label: 'skip'
39+
title:
40+
- '/.*\[skip\].*/'
41+
- label: 'major'
42+
title:
43+
- '/.*\[breaking\].*/'
44+
45+
replacers:
46+
- search: '/\[feat\]/g'
47+
replace: ''
48+
- search: '/\[fix\]/g'
49+
replace: ''
50+
- search: '/\[skip\]/g'
51+
replace: ''
52+
- search: '/\[breaking\]/g'
53+
replace: ''
54+
55+
template: |
56+
# What's Changed
57+
58+
$CHANGES
59+

.github/workflows/ci.yaml

Lines changed: 46 additions & 0 deletions
Original file line numberDiff line numberDiff line change
@@ -0,0 +1,46 @@
1+
name: CI
2+
3+
on:
4+
push:
5+
branches: [master, main]
6+
pull_request:
7+
branches: [master, main]
8+
9+
jobs:
10+
test:
11+
runs-on: ubuntu-latest
12+
strategy:
13+
fail-fast: false
14+
matrix:
15+
java: [ '17', '21', '25' ]
16+
steps:
17+
- run: env
18+
shell: bash
19+
- uses: actions/checkout@v6
20+
- uses: sbt/setup-sbt@v1
21+
- uses: coursier/cache-action@v8
22+
- uses: actions/setup-java@v5
23+
with:
24+
distribution: temurin
25+
java-version: ${{ matrix.java }}
26+
check-latest: true
27+
- name: tests
28+
run: |
29+
sbt clean test
30+
31+
formatting:
32+
runs-on: ubuntu-latest
33+
steps:
34+
- run: env
35+
shell: bash
36+
- uses: actions/checkout@v6
37+
- uses: sbt/setup-sbt@v1
38+
- uses: coursier/cache-action@v8
39+
- uses: actions/setup-java@v5
40+
with:
41+
distribution: temurin
42+
java-version: 17
43+
check-latest: true
44+
- name: Formatting
45+
run: |
46+
sbt scalafmtSbtCheck scalafmtCheck test:scalafmtCheck

.github/workflows/draft.yml

Lines changed: 26 additions & 0 deletions
Original file line numberDiff line numberDiff line change
@@ -0,0 +1,26 @@
1+
name: Release Drafter
2+
3+
on:
4+
push:
5+
branches:
6+
- main
7+
8+
pull_request:
9+
types: [opened, reopened, synchronize]
10+
11+
permissions:
12+
contents: read
13+
14+
jobs:
15+
update_release_draft:
16+
runs-on: ubuntu-latest
17+
permissions:
18+
# write permission is required to create a github release
19+
contents: write
20+
# write permission is required for autolabeler
21+
# otherwise, read permission is required at least
22+
pull-requests: write
23+
steps:
24+
- uses: release-drafter/release-drafter@v7.1.1
25+
env:
26+
GITHUB_TOKEN: ${{ secrets.GITHUB_TOKEN }}

.github/workflows/release.yml

Lines changed: 32 additions & 0 deletions
Original file line numberDiff line numberDiff line change
@@ -0,0 +1,32 @@
1+
name: Release
2+
3+
on:
4+
push:
5+
branches: [master, main]
6+
release:
7+
types: [ published ]
8+
9+
env:
10+
GITHUB_TOKEN: ${{ secrets.GITHUB_TOKEN }}
11+
12+
jobs:
13+
publish:
14+
runs-on: ubuntu-latest
15+
steps:
16+
- run: env
17+
shell: bash
18+
- uses: actions/checkout@v6
19+
- uses: sbt/setup-sbt@v1
20+
- uses: coursier/cache-action@v8
21+
- uses: olafurpg/setup-gpg@v3
22+
- uses: actions/setup-java@v5
23+
with:
24+
distribution: temurin
25+
java-version: 17
26+
check-latest: true
27+
- run: sbt ci-release
28+
env:
29+
PGP_PASSPHRASE: ${{ secrets.PGP_PASSPHRASE }}
30+
PGP_SECRET: ${{ secrets.PGP_SECRET }}
31+
SONATYPE_PASSWORD: ${{ secrets.SONATYPE_PASSWORD }}
32+
SONATYPE_USERNAME: ${{ secrets.SONATYPE_USERNAME }}
Lines changed: 20 additions & 0 deletions
Original file line numberDiff line numberDiff line change
@@ -0,0 +1,20 @@
1+
name: Scala Steward
2+
3+
# This workflow will launch everyday at 00:00
4+
on:
5+
schedule:
6+
- cron: '0 0 * * *'
7+
workflow_dispatch: {}
8+
9+
jobs:
10+
scala-steward:
11+
timeout-minutes: 45
12+
runs-on: ubuntu-latest
13+
name: Scala Steward
14+
steps:
15+
- uses: sbt/setup-sbt@v1
16+
- name: Scala Steward
17+
uses: scala-steward-org/scala-steward-action@v2.86.0
18+
with:
19+
github-repository: ${{ github.repository }}
20+
github-token: ${{ secrets.SCALA_STEWARD }}

.jvmopts

Lines changed: 11 additions & 0 deletions
Original file line numberDiff line numberDiff line change
@@ -0,0 +1,11 @@
1+
# This is a comment
2+
-Dfile.encoding=UTF8
3+
-Xms128M
4+
-Xmx4G
5+
-Xss16M
6+
-XX:+UseG1GC
7+
--add-opens=java.base/java.util=ALL-UNNAMED
8+
--add-opens=java.base/java.lang=ALL-UNNAMED
9+
--add-exports=java.base/sun.nio.ch=ALL-UNNAMED
10+
--add-exports=java.base/jdk.internal.misc=ALL-UNNAMED
11+
--enable-native-access=ALL-UNNAMED # Removes some warnings when starting sbt on JDK25+

.scalafix.conf

Lines changed: 22 additions & 0 deletions
Original file line numberDiff line numberDiff line change
@@ -0,0 +1,22 @@
1+
rules = [
2+
DisableSyntax
3+
// ExplicitResultTypes // Waiting for: https://github.com/scalacenter/scalafix/issues/1583
4+
LeakingImplicitClassVal
5+
NoAutoTupling
6+
NoValInForComprehension
7+
OrganizeImports
8+
RemoveUnused
9+
RedundantSyntax
10+
]
11+
12+
DisableSyntax.regex = []
13+
DisableSyntax.noReturns = true
14+
DisableSyntax.noXml = true
15+
DisableSyntax.noFinalize = true
16+
17+
// Preset rules compatible with Intellij IDEA
18+
// See: https://scalacenter.github.io/scalafix/docs/rules/OrganizeImports.html#intellij_2020_3
19+
OrganizeImports {
20+
preset = INTELLIJ_2020_3
21+
targetDialect = Scala3
22+
}

.scalafmt.conf

Lines changed: 31 additions & 2 deletions
Original file line numberDiff line numberDiff line change
@@ -1,2 +1,31 @@
1-
style = defaultWithAlign
2-
maxColumn = 120
1+
version = "3.10.7"
2+
runner.dialect = scala3 # https://scalameta.org/scalafmt/docs/configuration.html#scala-3
3+
runner.dialectOverride.allowSignificantIndentation = false # See https://x.com/ghostdogpr/status/1706589471469425074
4+
maxColumn = 140
5+
align.preset = most
6+
continuationIndent.defnSite = 2
7+
assumeStandardLibraryStripMargin = true
8+
docstrings.style = Asterisk
9+
lineEndings = preserve
10+
includeCurlyBraceInSelectChains = true
11+
danglingParentheses.preset = true
12+
optIn.annotationNewlines = true
13+
newlines.alwaysBeforeMultilineDef = false
14+
newlines.implicitParamListModifierPrefer = before
15+
trailingCommas = keep
16+
docstrings.wrap = no
17+
18+
rewrite.rules = [RedundantBraces, SortModifiers]
19+
20+
rewrite.sortModifiers.order = [
21+
"implicit", "override", "private", "protected", "final", "sealed", "abstract", "lazy"
22+
]
23+
rewrite.redundantBraces.generalExpressions = false
24+
rewrite.redundantBraces.stringInterpolation = true
25+
rewriteTokens = {
26+
"⇒": "=>"
27+
"→": "->"
28+
"←": "<-"
29+
}
30+
31+
project.excludePaths = []

.travis.yml

Lines changed: 0 additions & 12 deletions
This file was deleted.

0 commit comments

Comments
 (0)