Skip to content

Commit

Permalink
Merge pull request #1 from busymachines/update-build
Browse files Browse the repository at this point in the history
Update build
  • Loading branch information
lorandszakacs authored Aug 3, 2021
2 parents 22683ec + cd8636a commit 74cff18
Show file tree
Hide file tree
Showing 8 changed files with 132 additions and 120 deletions.
20 changes: 10 additions & 10 deletions .github/workflows/ci.yml
Original file line number Diff line number Diff line change
Expand Up @@ -9,9 +9,9 @@ name: Continuous Integration

on:
pull_request:
branches: ['*']
branches: ['**']
push:
branches: ['*']
branches: ['**']
tags: [v*]

env:
Expand All @@ -26,7 +26,7 @@ jobs:
strategy:
matrix:
os: [ubuntu-latest]
scala: [2.13.5]
scala: [2.13.6]
java: [adopt@1.8]
runs-on: ${{ matrix.os }}
steps:
Expand All @@ -53,9 +53,9 @@ jobs:
key: ${{ runner.os }}-sbt-cache-v2-${{ hashFiles('**/*.sbt') }}-${{ hashFiles('project/build.properties') }}

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

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

- name: Compress target directories
run: tar cf targets.tar target db-core-jdbc/target project/target
Expand All @@ -73,7 +73,7 @@ jobs:
strategy:
matrix:
os: [ubuntu-latest]
scala: [2.13.5]
scala: [2.13.6]
java: [adopt@1.8]
runs-on: ${{ matrix.os }}
steps:
Expand All @@ -99,17 +99,17 @@ jobs:
~/Library/Caches/Coursier/v1
key: ${{ runner.os }}-sbt-cache-v2-${{ hashFiles('**/*.sbt') }}-${{ hashFiles('project/build.properties') }}

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

- name: Inflate target directories (2.13.5)
- name: Inflate target directories (2.13.6)
run: |
tar xf targets.tar
rm targets.tar
- name: Import signing key
run: echo $PGP_SECRET | base64 -d | gpg --import

- run: sbt ++${{ matrix.scala }} release
- run: sbt --client '++${{ matrix.scala }}; release'
126 changes: 63 additions & 63 deletions .scalafmt.conf
Original file line number Diff line number Diff line change
Expand Up @@ -16,58 +16,68 @@
# limitations under the License.
#

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

#https://github.com/scalameta/scalafmt/releases
version = 2.7.5

project {
#if you don't specify that files ending in .scala .sbt with $,
# .scalafmt.conf is included in the formatting attempt
includeFilters = [
".*.\\.scala$"
".*\\..sbt$"
]
fileOverride {
"glob:**/src/main/scala/**" {
runner.dialect = scala213source3
}
"glob:**/src/test/scala/**" {
runner.dialect = scala213source3
}
"glob:**/src/main/scala-2/**" {
runner.dialect = scala213source3
}
"glob:**/src/test/scala-2/**" {
runner.dialect = scala213source3
}
"glob:**/src/main/scala-3/**" {
runner.dialect = scala3
}
"glob:**/src/test/scala-3/**" {
runner.dialect = scala3
}
"glob:**/project/*.scala" {
runner.dialect = scala212
}
"glob:**/*.sbt" {
runner.dialect = Sbt1
}
}

maxColumn = 120

# Note. Only for the truest vertical aligners. This is a new option,
# feel free to open PR enabling more crazy vertical alignment here.
# Expect changes.
align = most
align.openParenCallSite = false
align.openParenDefnSite = false
align.multiline = true
align.tokens."+" = [

align.tokens.add = [

{code = "<-", owner = "Enumerator.Generator"}
//Everything before the Term.Assign was the default regex. To find the
//default value, look through the code here:
//https://github.com/scalameta/scalafmt/blob/master/scalafmt-core/shared/src/main/scala/org/scalafmt/config/Align.scala
{code = "=", owner = "(Enumerator.Generator|Val|Defn.(Va(l|r)|Def|Type))|Term.Assign"}
{code = "<-", owner = "Enumerator.Generator"},

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

//used for aligning type definition
":"

//used when creating tuples
{code = "->", owner = "Term.ApplyInfix"},
"//", # used to align comments
":", # used for aligning type definition
{code = "->", owner = "Term.ApplyInfix"}, # used to align tuples 1 -> 2

//sbt specific
{code = "%", owner = "Term.ApplyInfix"},
{code = "%%", owner = "Term.ApplyInfix"}
{code = "%%%", owner = "Term.ApplyInfix"}
{code = ":=", owner = "Term.ApplyInfix"}
{code = "withSources", owner = "Term.ApplyInfix"}
{code = "%%", owner = "Term.ApplyInfix"},
{code = "%%%", owner = "Term.ApplyInfix"},
{code = ":=", owner = "Term.ApplyInfix"},
{code = "withSources", owner = "Term.ApplyInfix"},
"extends"
]

###############################################################################

continuationIndent {
callSite = 2
defnSite = 2
Expand All @@ -76,12 +86,16 @@ continuationIndent {
withSiteRelativeToExtends = 0
}

###############################################################################

verticalMultiline.atDefnSite = false
verticalMultiline.newlineAfterOpenParen = true
verticalMultiline.arityThreshold = 3

###############################################################################

newlines {
alwaysBeforeTopLevelStatements = true
topLevelStatements = [before]
sometimesBeforeColonInMethodReturnType = true
penalizeSingleSelectMultiArgList = false
alwaysBeforeElseAfterCurlyIf = true
Expand All @@ -91,30 +105,35 @@ newlines {
afterCurlyLambda = squash
}

###############################################################################

spaces {
afterKeywordBeforeParen = true
}

###############################################################################

binPack {
parentConstructors = true
literalArgumentLists = true
literalsMinArgCount = 5
}

###############################################################################

optIn {
breaksInsideChains = false
//preserves existing newlines in . chain calls.
//See: optIn.breakChainOnFirstMethodDot = true
# preserves existing newlines in . chain calls.
# See: optIn.breakChainOnFirstMethodDot = true
breakChainOnFirstMethodDot = true
blankLineBeforeDocstring = true
}

###############################################################################

rewrite {
rules = [
SortImports
SortModifiers
# if your for has more than one single <- then it gets transformed into a multit-line curly brace one
PreferCurlyFors
AvoidInfix
RedundantBraces
Expand All @@ -127,40 +146,21 @@ rewrite.redundantBraces.methodBodies = true
rewrite.redundantBraces.includeUnitMethods = false
rewrite.redundantBraces.stringInterpolation = true
rewrite.redundantBraces.parensForOneLineApply = true
rewrite.neverInfix.excludeFilters = [withSources]

#we only really want to disable infix notation
# for map and flatMap and the like, because it
# kills IDE performance and type inference
rewrite.neverInfix.excludeFilters = [
until
to
by
eq
ne
"should.*"
"contain.*"
"must.*"
in
be
of # behaviour of ("X")
taggedAs
thrownBy
synchronized
have
when
size
theSameElementsAs
withSources
]
###############################################################################

preset = default
danglingParentheses.preset = true

###############################################################################

assumeStandardLibraryStripMargin = true
includeNoParensInSelectChains = false
includeCurlyBraceInSelectChains = true
trailingCommas = multiple

###############################################################################

runner {
optimizer {
Expand All @@ -171,4 +171,4 @@ runner {
# minimum number of func arguments before config-style (look at top of file) is enabled
forceConfigStyleMinArgCount = 2
}
}
}
13 changes: 13 additions & 0 deletions CHANGELOG.md
Original file line number Diff line number Diff line change
Expand Up @@ -7,6 +7,19 @@ and this project adheres to [Semantic Versioning](https://semver.org/spec/v2.0.0

# unreleased

This is the first release that is also available for Scala 3!

### dependency upgrades

- [pureharm-core-anomaly](https://github.com/busymachines/pureharm-core/releases) `0.3.0`
- [pureharm-db-core](https://github.com/busymachines/pureharm-db-core/releases) `0.5.0`
- [pgjdbc](https://github.com/pgjdbc/pgjdbc/releases) `42.2.23`

### internals
- bump scalafmt to `3.0.0-RC6` — from `2.7.5`
- bump sbt to `1.5.5`
- bump sbt-spiewak to `0.21.0`

# 0.4.0

### dependency upgrades
Expand Down
Loading

0 comments on commit 74cff18

Please sign in to comment.