Skip to content

Commit

Permalink
Merge pull request #1 from busymachines/feature/ce3-support
Browse files Browse the repository at this point in the history
cats-effect 3 + Scala 3 support
  • Loading branch information
lorandszakacs authored Aug 5, 2021
2 parents 95697ed + d5a44e6 commit 24db40b
Show file tree
Hide file tree
Showing 16 changed files with 231 additions and 183 deletions.
32 changes: 21 additions & 11 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, 3.0.1]
java: [adopt@1.8]
runs-on: ${{ matrix.os }}
steps:
Expand All @@ -53,12 +53,12 @@ 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 config-ciris/target project/target
run: tar cf targets.tar target config-ciris/target config-ciris-ip4s/target project/target

- name: Upload target directories
uses: actions/upload-artifact@v2
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,27 @@ 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: Download target directories (3.0.1)
uses: actions/download-artifact@v2
with:
name: target-${{ matrix.os }}-3.0.1-${{ matrix.java }}

- name: Inflate target directories (3.0.1)
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
}
}
}
18 changes: 16 additions & 2 deletions CHANGELOG.md
Original file line number Diff line number Diff line change
Expand Up @@ -7,15 +7,29 @@ and this project adheres to [Semantic Versioning](https://semver.org/spec/v2.0.0

# unreleased

This release brings cats-effect 3 and Scala 3 support!

- split out `ip4s` support in a seperate module called `pureharm-config-ciris-ip4s`, simply mixin `busymachines.pureharm.config.CirisIp4sInstances` to bring in typeclass instances.

### scala versions
- add build for Scala `3`

### dependency upgrades
- [ciris](https://github.com/vlovgr/ciris/releases) `2.0.1`
- [cats-effect](https://github.com/typelevel/cats-effect/releases) `3.2.1`
- [ip4s](https://github.com/Comcast/ip4s/releases) `3.0.3`
- [pureharm-core-sprout](https://github.com/busymachines/pureharm-core/releases) `0.3.0`
- [pureharm-core-anomaly](https://github.com/busymachines/pureharm-core/releases) `0.3.0`

# 0.1.0

Add type aliases for the [`ciris`](https://github.com/vlovgr/ciris/releases) library, w/ sprout integrations,
and support for reading `ip4s` types.

### Scala versions
### scala versions
- add build for Scala `2.13`

### Dependencies
### dependency upgrades
- [ciris](https://github.com/vlovgr/ciris/releases) `1.2.1`
- [ip4s](https://github.com/Comcast/ip4s/releases) `2.0.1`
- [pureharm-core-sprout](https://github.com/busymachines/pureharm-core/releases) `0.2.0`
Expand Down
Loading

0 comments on commit 24db40b

Please sign in to comment.