Skip to content

Commit 248be6e

Browse files
Merge pull request #2 from busymachines/feature/scala3-ce3-support
CE3 + Scala 3 support
2 parents 4f6fdc8 + 4e71ba1 commit 248be6e

File tree

25 files changed

+1007
-252
lines changed

25 files changed

+1007
-252
lines changed

.github/workflows/ci.yml

Lines changed: 21 additions & 11 deletions
Original file line numberDiff line numberDiff line change
@@ -9,9 +9,9 @@ name: Continuous Integration
99

1010
on:
1111
pull_request:
12-
branches: ['*']
12+
branches: ['**']
1313
push:
14-
branches: ['*']
14+
branches: ['**']
1515
tags: [v*]
1616

1717
env:
@@ -26,7 +26,7 @@ jobs:
2626
strategy:
2727
matrix:
2828
os: [ubuntu-latest]
29-
scala: [2.13.5]
29+
scala: [2.13.6, 3.0.1]
3030
3131
runs-on: ${{ matrix.os }}
3232
steps:
@@ -53,12 +53,12 @@ jobs:
5353
key: ${{ runner.os }}-sbt-cache-v2-${{ hashFiles('**/*.sbt') }}-${{ hashFiles('project/build.properties') }}
5454

5555
- name: Check that workflows are up to date
56-
run: sbt ++${{ matrix.scala }} githubWorkflowCheck
56+
run: sbt --client '++${{ matrix.scala }}; githubWorkflowCheck'
5757

58-
- run: sbt ++${{ matrix.scala }} ci
58+
- run: sbt --client '++${{ matrix.scala }}; ci'
5959

6060
- name: Compress target directories
61-
run: tar cf targets.tar target db-testkit/target db-test-data/target project/target
61+
run: tar cf targets.tar target db-test-data/target db-test-data-ce2/target db-testkit-ce2/target db-testkit/target project/target
6262

6363
- name: Upload target directories
6464
uses: actions/upload-artifact@v2
@@ -73,7 +73,7 @@ jobs:
7373
strategy:
7474
matrix:
7575
os: [ubuntu-latest]
76-
scala: [2.13.5]
76+
scala: [2.13.6]
7777
7878
runs-on: ${{ matrix.os }}
7979
steps:
@@ -99,17 +99,27 @@ jobs:
9999
~/Library/Caches/Coursier/v1
100100
key: ${{ runner.os }}-sbt-cache-v2-${{ hashFiles('**/*.sbt') }}-${{ hashFiles('project/build.properties') }}
101101

102-
- name: Download target directories (2.13.5)
102+
- name: Download target directories (2.13.6)
103103
uses: actions/download-artifact@v2
104104
with:
105-
name: target-${{ matrix.os }}-2.13.5-${{ matrix.java }}
105+
name: target-${{ matrix.os }}-2.13.6-${{ matrix.java }}
106106

107-
- name: Inflate target directories (2.13.5)
107+
- name: Inflate target directories (2.13.6)
108+
run: |
109+
tar xf targets.tar
110+
rm targets.tar
111+
112+
- name: Download target directories (3.0.1)
113+
uses: actions/download-artifact@v2
114+
with:
115+
name: target-${{ matrix.os }}-3.0.1-${{ matrix.java }}
116+
117+
- name: Inflate target directories (3.0.1)
108118
run: |
109119
tar xf targets.tar
110120
rm targets.tar
111121
112122
- name: Import signing key
113123
run: echo $PGP_SECRET | base64 -d | gpg --import
114124

115-
- run: sbt ++${{ matrix.scala }} release
125+
- run: sbt --client '++${{ matrix.scala }}; release'

.scalafmt.conf

Lines changed: 63 additions & 63 deletions
Original file line numberDiff line numberDiff line change
@@ -16,58 +16,68 @@
1616
# limitations under the License.
1717
#
1818

19-
# See https://scalameta.org/scalafmt/docs/configuration.html for details,
20-
# mostly done by trial and error. But I guess this formatting is "good enough"
19+
# See https://scalameta.org/scalafmt/docs/configuration.html for details
2120
#
21+
# https://github.com/scalameta/scalafmt/releases
22+
version = 3.0.0-RC6
2223

23-
#https://github.com/scalameta/scalafmt/releases
24-
version = 2.7.5
25-
26-
project {
27-
#if you don't specify that files ending in .scala .sbt with $,
28-
# .scalafmt.conf is included in the formatting attempt
29-
includeFilters = [
30-
".*.\\.scala$"
31-
".*\\..sbt$"
32-
]
24+
fileOverride {
25+
"glob:**/src/main/scala/**" {
26+
runner.dialect = scala213source3
27+
}
28+
"glob:**/src/test/scala/**" {
29+
runner.dialect = scala213source3
30+
}
31+
"glob:**/src/main/scala-2/**" {
32+
runner.dialect = scala213source3
33+
}
34+
"glob:**/src/test/scala-2/**" {
35+
runner.dialect = scala213source3
36+
}
37+
"glob:**/src/main/scala-3/**" {
38+
runner.dialect = scala3
39+
}
40+
"glob:**/src/test/scala-3/**" {
41+
runner.dialect = scala3
42+
}
43+
"glob:**/project/*.scala" {
44+
runner.dialect = scala212
45+
}
46+
"glob:**/*.sbt" {
47+
runner.dialect = Sbt1
48+
}
3349
}
3450

3551
maxColumn = 120
3652

37-
# Note. Only for the truest vertical aligners. This is a new option,
38-
# feel free to open PR enabling more crazy vertical alignment here.
39-
# Expect changes.
4053
align = most
4154
align.openParenCallSite = false
4255
align.openParenDefnSite = false
4356
align.multiline = true
57+
align.tokens."+" = [
4458

45-
align.tokens.add = [
46-
47-
{code = "<-", owner = "Enumerator.Generator"}
48-
//Everything before the Term.Assign was the default regex. To find the
49-
//default value, look through the code here:
50-
//https://github.com/scalameta/scalafmt/blob/master/scalafmt-core/shared/src/main/scala/org/scalafmt/config/Align.scala
51-
{code = "=", owner = "(Enumerator.Generator|Val|Defn.(Va(l|r)|Def|Type))|Term.Assign"}
59+
{code = "<-", owner = "Enumerator.Generator"},
5260

53-
//used to align comments
54-
"//"
61+
# Everything before the Term.Assign was the default regex. To find the
62+
# default value, look through the code here:
63+
# https://github.com/scalameta/scalafmt/blob/master/scalafmt-core/shared/src/main/scala/org/scalafmt/config/Align.scala
64+
{code = "=", owner = "(Enumerator.Generator|Val|Defn.(Va(l|r)|Def|Type))|Term.Assign|Param"},
5565

56-
//used for aligning type definition
57-
":"
58-
59-
//used when creating tuples
60-
{code = "->", owner = "Term.ApplyInfix"},
66+
"//", # used to align comments
67+
":", # used for aligning type definition
68+
{code = "->", owner = "Term.ApplyInfix"}, # used to align tuples 1 -> 2
6169

6270
//sbt specific
6371
{code = "%", owner = "Term.ApplyInfix"},
64-
{code = "%%", owner = "Term.ApplyInfix"}
65-
{code = "%%%", owner = "Term.ApplyInfix"}
66-
{code = ":=", owner = "Term.ApplyInfix"}
67-
{code = "withSources", owner = "Term.ApplyInfix"}
72+
{code = "%%", owner = "Term.ApplyInfix"},
73+
{code = "%%%", owner = "Term.ApplyInfix"},
74+
{code = ":=", owner = "Term.ApplyInfix"},
75+
{code = "withSources", owner = "Term.ApplyInfix"},
6876
"extends"
6977
]
7078

79+
###############################################################################
80+
7181
continuationIndent {
7282
callSite = 2
7383
defnSite = 2
@@ -76,12 +86,16 @@ continuationIndent {
7686
withSiteRelativeToExtends = 0
7787
}
7888

89+
###############################################################################
90+
7991
verticalMultiline.atDefnSite = false
8092
verticalMultiline.newlineAfterOpenParen = true
8193
verticalMultiline.arityThreshold = 3
8294

95+
###############################################################################
96+
8397
newlines {
84-
alwaysBeforeTopLevelStatements = true
98+
topLevelStatements = [before]
8599
sometimesBeforeColonInMethodReturnType = true
86100
penalizeSingleSelectMultiArgList = false
87101
alwaysBeforeElseAfterCurlyIf = true
@@ -91,30 +105,35 @@ newlines {
91105
afterCurlyLambda = squash
92106
}
93107

108+
###############################################################################
109+
94110
spaces {
95111
afterKeywordBeforeParen = true
96112
}
97113

114+
###############################################################################
115+
98116
binPack {
99117
parentConstructors = true
100118
literalArgumentLists = true
101119
literalsMinArgCount = 5
102120
}
103121

122+
###############################################################################
104123

105124
optIn {
106125
breaksInsideChains = false
107-
//preserves existing newlines in . chain calls.
108-
//See: optIn.breakChainOnFirstMethodDot = true
126+
# preserves existing newlines in . chain calls.
127+
# See: optIn.breakChainOnFirstMethodDot = true
109128
breakChainOnFirstMethodDot = true
110129
blankLineBeforeDocstring = true
111130
}
112131

132+
###############################################################################
133+
113134
rewrite {
114135
rules = [
115-
SortImports
116136
SortModifiers
117-
# if your for has more than one single <- then it gets transformed into a multit-line curly brace one
118137
PreferCurlyFors
119138
AvoidInfix
120139
RedundantBraces
@@ -127,40 +146,21 @@ rewrite.redundantBraces.methodBodies = true
127146
rewrite.redundantBraces.includeUnitMethods = false
128147
rewrite.redundantBraces.stringInterpolation = true
129148
rewrite.redundantBraces.parensForOneLineApply = true
149+
rewrite.neverInfix.excludeFilters = [withSources]
130150

131-
#we only really want to disable infix notation
132-
# for map and flatMap and the like, because it
133-
# kills IDE performance and type inference
134-
rewrite.neverInfix.excludeFilters = [
135-
until
136-
to
137-
by
138-
eq
139-
ne
140-
"should.*"
141-
"contain.*"
142-
"must.*"
143-
in
144-
be
145-
of # behaviour of ("X")
146-
taggedAs
147-
thrownBy
148-
synchronized
149-
have
150-
when
151-
size
152-
theSameElementsAs
153-
withSources
154-
]
151+
###############################################################################
155152

156153
preset = default
157154
danglingParentheses.preset = true
158155

156+
###############################################################################
157+
159158
assumeStandardLibraryStripMargin = true
160159
includeNoParensInSelectChains = false
161160
includeCurlyBraceInSelectChains = true
162161
trailingCommas = multiple
163162

163+
###############################################################################
164164

165165
runner {
166166
optimizer {
@@ -171,4 +171,4 @@ runner {
171171
# minimum number of func arguments before config-style (look at top of file) is enabled
172172
forceConfigStyleMinArgCount = 2
173173
}
174-
}
174+
}

CHANGELOG.md

Lines changed: 28 additions & 0 deletions
Original file line numberDiff line numberDiff line change
@@ -7,6 +7,34 @@ and this project adheres to [Semantic Versioning](https://semver.org/spec/v2.0.0
77

88
# unreleased
99

10+
# 0.3.0
11+
12+
This is the first release for a stable Scala 3 version, and with cats-effect 3 support!
13+
14+
### :warning: breaking
15+
- `pureharm-db-testkit` now depends on cats-effect `3.2.1`, and the corresponding dependencies for it.
16+
- `pureharm-db-testkit-ce2` is binary, and source compatible with `pureharm-db-testkit` from version `0.2.0`, so if you haven't migrated to CE3 yet, use the former module.
17+
18+
### Dependency upgrades
19+
- [pureharm-core](https://github.com/busymachines/pureharm-core/releases) `0.3.0`
20+
- [pureharm-effects-cats](https://github.com/busymachines/pureharm-effects-cats/releases) `0.5.0`
21+
- [pureharm-testkit](https://github.com/busymachines/pureharm-testkit/releases) `0.4.0`
22+
- [pureharm-db-core](https://github.com/busymachines/pureharm-db-core/releases) `0.5.0`
23+
- [pureharm-db-flyway](https://github.com/busymachines/pureharm-db-flyway/releases) `0.6.0`
24+
25+
### New Scala versions:
26+
- `2.13.6`
27+
- `3.0.1` for JVM + JS platforms
28+
- drop `3.0.0-RC2`, `3.0.0-RC3`
29+
30+
### internals
31+
- bump scalafmt to `3.0.0-RC6` — from `2.7.5`
32+
- bump sbt to `1.5.5`
33+
- bump sbt-spiewak to `0.21.0`
34+
- bump sbt-scalafmt to `2.4.3`
35+
- bump sbt-scalajs-crossproject to `1.1.0`
36+
- bump sbt-scalajs to `1.6.0`
37+
1038
# 0.2.0
1139

1240
### breaking changes:

README.md

Lines changed: 13 additions & 9 deletions
Original file line numberDiff line numberDiff line change
@@ -4,17 +4,21 @@ See [changelog](./CHANGELOG.md).
44

55
We do not even pretend to support anything other than Postgresql.
66

7+
## Scala versions
8+
- `2.13`: JVM
9+
- `3`: JVM
10+
711
## modules
812

9-
- `"com.busymachines" %% "pureharm-db-testkit" % "0.2.0"`. Which has these as its main dependencies:
10-
- [pureharm-core-anomaly](https://github.com/busymachines/pureharm-core/releases) `0.2.0`
11-
- [pureharm-core-sprout](https://github.com/busymachines/pureharm-core/releases) `0.2.0`
12-
- [pureharm-core-identifiable](https://github.com/busymachines/pureharm-core/releases) `0.2.0`
13-
- [pureharm-effects-cats](https://github.com/busymachines/pureharm-effects-cats/releases) `0.4.0`
14-
- [pureharm-testkit](https://github.com/busymachines/pureharm-testkit/releases) `0.3.0`
15-
- [pureharm-db-core](https://github.com/busymachines/pureharm-db-core/releases) `0.4.0`
16-
- [pureharm-db-flyway](https://github.com/busymachines/pureharm-db-flyway/releases) `0.4.0`
17-
- `"com.busymachines" %% "pureharm-db-test-data" % "0.2.0"`
13+
- `"com.busymachines" %% "pureharm-db-testkit" % "0.3.0"`. Which has these as its main dependencies:
14+
- [pureharm-core-anomaly](https://github.com/busymachines/pureharm-core/releases) `0.3.0`
15+
- [pureharm-core-sprout](https://github.com/busymachines/pureharm-core/releases) `0.3.0`
16+
- [pureharm-core-identifiable](https://github.com/busymachines/pureharm-core/releases) `0.3.0`
17+
- [pureharm-effects-cats](https://github.com/busymachines/pureharm-effects-cats/releases) `0.5.0`
18+
- [pureharm-testkit](https://github.com/busymachines/pureharm-testkit/releases) `0.4.0`
19+
- [pureharm-db-core](https://github.com/busymachines/pureharm-db-core/releases) `0.5.0`
20+
- [pureharm-db-flyway](https://github.com/busymachines/pureharm-db-flyway/releases) `0.6.0`
21+
- `"com.busymachines" %% "pureharm-db-test-data" % "0.3.0"`
1822
- used only for common tests between different DB modules
1923

2024
## usage

0 commit comments

Comments
 (0)