Skip to content

Commit c421319

Browse files
committed
Upgrade sbt and sbt plugins / Clean up
* sbt-devoops to 3.0.0 * sbt-docusaur to 0.15.0 * Clean up the code as suggested by sbt-tpolecat
1 parent baf02cf commit c421319

File tree

22 files changed

+408
-382
lines changed

22 files changed

+408
-382
lines changed

.github/workflows/checks.yml

Lines changed: 17 additions & 13 deletions
Original file line numberDiff line numberDiff line change
@@ -20,17 +20,19 @@ jobs:
2020
strategy:
2121
matrix:
2222
scala:
23-
- { name: "Scala", java-version: "11", java-distribution: "temurin", report: "" }
23+
- { name: "Scala 2", version: "2.12.13", binary-version: "2.12", java-version: "11", java-distribution: "temurin", report: "" }
24+
- { name: "Scala 2", version: "2.13.6", binary-version: "2.13", java-version: "11", java-distribution: "temurin", report: "" }
25+
# - { name: "Scala 3", version: "3.0.2", binary-version: "3", java-version: "11", java-distribution: "temurin", report: "" }
2426

2527
steps:
26-
- uses: actions/checkout@v4
28+
- uses: actions/checkout@v4.1.1
2729
- uses: actions/setup-java@v3
2830
with:
2931
java-version: ${{ matrix.scala.java-version }}
3032
distribution: ${{ matrix.scala.java-distribution }}
3133

3234
- name: Cache SBT
33-
uses: actions/cache@v3
35+
uses: actions/cache@v3.3.2
3436
with:
3537
path: |
3638
~/.ivy2/cache
@@ -40,13 +42,13 @@ jobs:
4042
restore-keys: |
4143
${{ runner.os }}-sbt
4244
43-
- name: "[Push] Build All for ${{ matrix.scala.name }} - ${{ github.run_number }}"
45+
- name: "[Push] Build All for ${{ matrix.scala.name }} v${{ matrix.scala.version }} - ${{ github.run_number }}"
4446
if: github.event_name == 'push'
4547
env:
4648
CURRENT_BRANCH_NAME: ${{ github.ref }}
4749
RUN_ID: ${{ github.run_id }}
4850
RUN_NUMBER: ${{ github.run_number }}
49-
JAVA_OPTS: ${{ env.GH_JAVA_OPTS }}
51+
JVM_OPTS: ${{ env.GH_JVM_OPTS }}
5052
run: |
5153
echo "[BEFORE]CURRENT_BRANCH_NAME=${CURRENT_BRANCH_NAME}"
5254
export CURRENT_BRANCH_NAME="${CURRENT_BRANCH_NAME#refs/heads/}"
@@ -55,28 +57,30 @@ jobs:
5557
echo "RUN_NUMBER=${RUN_NUMBER}"
5658
echo "Push #${PUSH_NUMBER}"
5759
java -version
58-
echo "JAVA_OPTS=${JAVA_OPTS}"
60+
echo "JVM_OPTS=${JVM_OPTS}"
5961
echo "SBT_OPTS=${SBT_OPTS}"
6062
sbt \
61-
"+scalafixAll --check" \
62-
+scalafmtCheckAll
63+
++${{ matrix.scala.version }}! \
64+
"scalafixAll --check" \
65+
scalafmtCheckAll
6366
64-
- name: "[PR] Build All for ${{ matrix.scala.name }} - PR-#${{ github.event.pull_request.number }} - ${{ github.run_number }}"
67+
- name: "[PR] Build All for ${{ matrix.scala.name }} v${{ matrix.scala.version }} - PR-#${{ github.event.pull_request.number }} - ${{ github.run_number }}"
6568
if: github.event_name == 'pull_request'
6669
env:
6770
CURRENT_BRANCH_NAME: ${{ github.base_ref }}
6871
RUN_ID: ${{ github.run_id }}
6972
RUN_NUMBER: ${{ github.run_number }}
7073
PR_NUMBER: ${{ github.event.pull_request.number }}
71-
JAVA_OPTS: ${{ env.GH_JAVA_OPTS }}
74+
JVM_OPTS: ${{ env.GH_JVM_OPTS }}
7275
run: |
7376
echo "Rull request to the '${CURRENT_BRANCH_NAME}' branch"
7477
echo "RUN_ID=${RUN_ID}"
7578
echo "RUN_NUMBER=${RUN_NUMBER}"
7679
echo "PR #${PR_NUMBER}"
7780
java -version
78-
echo "JAVA_OPTS=${JAVA_OPTS}"
81+
echo "JVM_OPTS=${JVM_OPTS}"
7982
echo "SBT_OPTS=${SBT_OPTS}"
8083
sbt \
81-
"+scalafixAll --check" \
82-
+scalafmtCheckAll
84+
++${{ matrix.scala.version }}! \
85+
"scalafixAll --check" \
86+
scalafmtCheckAll

.scalafix-scala2.conf

Lines changed: 73 additions & 53 deletions
Original file line numberDiff line numberDiff line change
@@ -3,58 +3,78 @@ rules = [
33
LeakingImplicitClassVal
44
NoValInForComprehension
55
ProcedureSyntax
6-
RedundantSyntax
7-
RemoveUnused
8-
9-
# xuwei-k/scalafix-rules
10-
AddExplicitImplicitTypes
11-
AddLambdaParamParentheses
12-
CirceCodec
13-
CollectHead
14-
CollectHeadOption
15-
16-
FlatTraverse
17-
ImplicitValueClass
18-
KindProjector
19-
LambdaParamParentheses
20-
MapDistinctSize
21-
MapSequenceTraverse
22-
NoElse
23-
ObjectSelfType
24-
OptionMapFlatMap
25-
OptionMatchToRight
26-
27-
SimplifyForYield
28-
ThrowableToNonFatal
29-
UnnecessaryCase
30-
UnnecessaryMatch
31-
UnnecessarySort
32-
33-
UnusedConstructorParams
34-
UnusedTypeParams
35-
WithFilter
366
]
7+
DisableSyntax.noVars = true
8+
DisableSyntax.noThrows = true
9+
DisableSyntax.noNulls = true
10+
DisableSyntax.noReturns = true
11+
DisableSyntax.noWhileLoops = true
12+
DisableSyntax.noAsInstanceOf = true
13+
DisableSyntax.noIsInstanceOf = true
14+
DisableSyntax.noXml = true
15+
DisableSyntax.noDefaultArgs = true
16+
DisableSyntax.noFinalVal = true
17+
DisableSyntax.noFinalize = true
18+
DisableSyntax.noValPatterns = true
19+
DisableSyntax.regex = []
3720

38-
DisableSyntax {
39-
noVars = true
40-
noThrows = true
41-
noNulls = true
42-
noReturns = true
43-
noWhileLoops = true
44-
noAsInstanceOf = true
45-
noIsInstanceOf = true
46-
noXml = true
47-
noDefaultArgs = true
48-
noFinalVal = true
49-
noFinalize = true
50-
noValPatterns = true
51-
regex = []
52-
}
53-
54-
RemoveUnused {
55-
imports = true
56-
privates = true
57-
locals = true
58-
patternvars = true
59-
params = true
60-
}
21+
//rules = [
22+
// DisableSyntax
23+
// LeakingImplicitClassVal
24+
// NoValInForComprehension
25+
// ProcedureSyntax
26+
// RedundantSyntax
27+
// RemoveUnused
28+
//
29+
// # xuwei-k/scalafix-rules
30+
// AddExplicitImplicitTypes
31+
// AddLambdaParamParentheses
32+
// CirceCodec
33+
// CollectHead
34+
// CollectHeadOption
35+
//
36+
// FlatTraverse
37+
// ImplicitValueClass
38+
// KindProjector
39+
// LambdaParamParentheses
40+
// MapDistinctSize
41+
// MapSequenceTraverse
42+
// NoElse
43+
// ObjectSelfType
44+
// OptionMapFlatMap
45+
// OptionMatchToRight
46+
//
47+
// SimplifyForYield
48+
// ThrowableToNonFatal
49+
// UnnecessaryCase
50+
// UnnecessaryMatch
51+
// UnnecessarySort
52+
//
53+
// UnusedConstructorParams
54+
// UnusedTypeParams
55+
// WithFilter
56+
//]
57+
//
58+
//DisableSyntax {
59+
// noVars = true
60+
// noThrows = true
61+
// noNulls = true
62+
// noReturns = true
63+
// noWhileLoops = true
64+
// noAsInstanceOf = true
65+
// noIsInstanceOf = true
66+
// noXml = true
67+
// noDefaultArgs = true
68+
// noFinalVal = true
69+
// noFinalize = true
70+
// noValPatterns = true
71+
// regex = []
72+
//}
73+
//
74+
//RemoveUnused {
75+
// imports = true
76+
// privates = true
77+
// locals = true
78+
// patternvars = true
79+
// params = true
80+
//}

.scalafix-scala3.conf

Lines changed: 63 additions & 44 deletions
Original file line numberDiff line numberDiff line change
@@ -2,49 +2,68 @@ rules = [
22
DisableSyntax
33
LeakingImplicitClassVal
44
NoValInForComprehension
5-
RedundantSyntax
6-
7-
# xuwei-k/scalafix-rules
8-
AddExplicitImplicitTypes
9-
AddLambdaParamParentheses
10-
CirceCodec
11-
CollectHead
12-
CollectHeadOption
13-
14-
FlatTraverse
15-
ImplicitValueClass
16-
KindProjector
17-
LambdaParamParentheses
18-
MapDistinctSize
19-
MapSequenceTraverse
20-
NoElse
21-
ObjectSelfType
22-
OptionMapFlatMap
23-
OptionMatchToRight
24-
25-
SimplifyForYield
26-
ThrowableToNonFatal
27-
UnnecessaryCase
28-
UnnecessaryMatch
29-
UnnecessarySort
30-
31-
UnusedConstructorParams
32-
UnusedTypeParams
33-
WithFilter
345
]
6+
DisableSyntax.noVars = true
7+
DisableSyntax.noThrows = true
8+
DisableSyntax.noNulls = true
9+
DisableSyntax.noReturns = true
10+
DisableSyntax.noWhileLoops = true
11+
DisableSyntax.noAsInstanceOf = true
12+
DisableSyntax.noIsInstanceOf = true
13+
DisableSyntax.noXml = true
14+
DisableSyntax.noDefaultArgs = true
15+
DisableSyntax.noFinalVal = true
16+
DisableSyntax.noFinalize = true
17+
DisableSyntax.noValPatterns = true
18+
DisableSyntax.regex = []
3519

36-
DisableSyntax {
37-
noVars = true
38-
noThrows = true
39-
noNulls = true
40-
noReturns = true
41-
noWhileLoops = true
42-
noAsInstanceOf = true
43-
noIsInstanceOf = true
44-
noXml = true
45-
noDefaultArgs = true
46-
noFinalVal = true
47-
noFinalize = true
48-
noValPatterns = true
49-
regex = []
50-
}
20+
//rules = [
21+
// DisableSyntax
22+
// LeakingImplicitClassVal
23+
// NoValInForComprehension
24+
// RedundantSyntax
25+
//
26+
// # xuwei-k/scalafix-rules
27+
// AddExplicitImplicitTypes
28+
// AddLambdaParamParentheses
29+
// CirceCodec
30+
// CollectHead
31+
// CollectHeadOption
32+
//
33+
// FlatTraverse
34+
// ImplicitValueClass
35+
// KindProjector
36+
// LambdaParamParentheses
37+
// MapDistinctSize
38+
// MapSequenceTraverse
39+
// NoElse
40+
// ObjectSelfType
41+
// OptionMapFlatMap
42+
// OptionMatchToRight
43+
//
44+
// SimplifyForYield
45+
// ThrowableToNonFatal
46+
// UnnecessaryCase
47+
// UnnecessaryMatch
48+
// UnnecessarySort
49+
//
50+
// UnusedConstructorParams
51+
// UnusedTypeParams
52+
// WithFilter
53+
//]
54+
//
55+
//DisableSyntax {
56+
// noVars = true
57+
// noThrows = true
58+
// noNulls = true
59+
// noReturns = true
60+
// noWhileLoops = true
61+
// noAsInstanceOf = true
62+
// noIsInstanceOf = true
63+
// noXml = true
64+
// noDefaultArgs = true
65+
// noFinalVal = true
66+
// noFinalize = true
67+
// noValPatterns = true
68+
// regex = []
69+
//}

0 commit comments

Comments
 (0)