- Sponsor
-
Notifications
You must be signed in to change notification settings - Fork 29
Commit
This commit does not belong to any branch on this repository, and may belong to a fork outside of the repository.
Build: Use shared scalafmt config; add intellij excluded directories
Showing
10 changed files
with
64 additions
and
176 deletions.
There are no files selected for viewing
This file contains bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
Original file line number | Diff line number | Diff line change |
---|---|---|
@@ -1,15 +1,25 @@ | ||
target | ||
.idea | ||
.bsp | ||
.vscode | ||
*.code-workspace | ||
.bloop | ||
.metals | ||
project/metals.sbt | ||
project/project | ||
|
||
.DS_Store | ||
|
||
target | ||
|
||
.metals | ||
.bloop | ||
.bsp | ||
|
||
project/metals.sbt | ||
project/.bloop | ||
|
||
yarn.lock | ||
!website/yarn.lock | ||
|
||
.downloads | ||
|
||
website/node_modules | ||
website/build | ||
website/i18n/* | ||
|
||
/.bsp | ||
websiteJS/package-lock.json |
This file contains bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
Original file line number | Diff line number | Diff line change |
---|---|---|
@@ -1,175 +1,9 @@ | ||
version = "3.8.4-RC1" | ||
include ".downloads/.scalafmt.shared.conf" | ||
|
||
runner.dialect = "scala213" | ||
|
||
# !!! TODO !!! Update styles in the generator to match scalafmt config | ||
# - Maybe make a separate config for these files, that has two lines before method names, see https://scalameta.org/scalafmt/docs/configuration.html#fileoverride | ||
# - Does this exclusion actually work? IntelliJ seems to ignore it | ||
project.excludePaths = [ | ||
"glob:**/project/VersionHelper.scala", | ||
"glob:**/src/*/scala-3/**" | ||
"glob:**/src/*/scala/com/raquo/airstream/combine/generated/**" | ||
] | ||
|
||
maxColumn = 1000 | ||
|
||
indent.main = 2 | ||
indent.callSite = 2 | ||
indent.binPackCallSite = 2 | ||
indent.ctrlSite = 2 | ||
indent.defnSite = 2 | ||
indent.binPackDefnSite = 2 | ||
indent.ctorSite = 2 | ||
indent.matchSite = 2 | ||
indent.caseSite = 2 | ||
indent.extendSite = 0 | ||
indent.withSiteRelativeToExtends = 0 | ||
indent.commaSiteRelativeToExtends = 2 # 0 is not allowed | ||
indent.extraBeforeOpenParenDefnSite = 0 | ||
indent.relativeToLhsLastLine = [match, infix] | ||
indent.fewerBraces = never | ||
indent.afterInfixSite = 2 # not sure what this is https://scalameta.org/scalafmt/docs/configuration.html#indentafterinfixsite | ||
|
||
# Indenting of nested calls: | ||
# !!! #TODO !!!: https://scalameta.org/scalafmt/docs/configuration.html#indent-for-binpackcallsite | ||
# !!! #TODO !!!: https://scalameta.org/scalafmt/docs/configuration.html#indentoperator | ||
|
||
align.preset = none | ||
|
||
# TODO: alignment can be more detailed but requires knowing Scala types | ||
# https://scalameta.org/scalafmt/docs/configuration.html#aligntokens | ||
|
||
align.arrowEnumeratorGenerator = false | ||
align.closeParenSite = false | ||
align.openParenCallSite = false | ||
align.openBracketCallSite = false | ||
align.openParenCtrlSite = false | ||
align.openParenDefnSite = false | ||
align.openBracketDefnSite = false | ||
align.openParenCallSite = false | ||
align.beforeOpenParenCallSite = false # ??? https://scalameta.org/scalafmt/docs/configuration.html#alignbeforeopenparenxxxsite | ||
align.beforeOpenParenDefnSite = false # ??? https://scalameta.org/scalafmt/docs/configuration.html#alignbeforeopenparenxxxsite | ||
align.stripMargin = true | ||
align.multiline = false | ||
align.allowOverflow = true # Not sure, it's unused since alignment is disabled https://scalameta.org/scalafmt/docs/configuration.html#alignallowoverflow | ||
align.inInterpolation = false | ||
align.delayUntilSpace = true | ||
|
||
# https://scalameta.org/scalafmt/docs/configuration.html#binpacking | ||
binPack.callSite = onelinesjs | ||
binPack.parentConstructors = keep | ||
|
||
newlines.source = keep | ||
# TODO: ??? https://scalameta.org/scalafmt/docs/configuration.html#newlinestoplevelstatementblanklines | ||
newlines.topLevelStatementBlankLines = [] | ||
newlines.topLevelBodyIfMinStatements = [] | ||
newlines.beforeTemplateBodyIfBreakInParentCtors = false # TODO not sure https://scalameta.org/scalafmt/docs/configuration.html#newlinesbeforetemplatebodyifbreakinparentctors | ||
newlines.beforeMultiline = keep # !!! TODO not sure, maybe `unfold` https://scalameta.org/scalafmt/docs/configuration.html#newlinesbeforemultiline | ||
newlines.forceBeforeMultilineAssign = never | ||
newlines.forceBeforeAssign = never | ||
newlines.beforeTypeBounds = keep | ||
newlines.alwaysBeforeElseAfterCurlyIf = false | ||
newlines.beforeCurlyLambdaParams = never | ||
newlines.afterCurlyLambdaParams = keep | ||
newlines.configStyleCallSite.prefer = false # Lets us keep all method arguments on the same line, without forcing it | ||
# newlines.implicitParamListModifierPrefer = after # TODO I want this to be before, but scalafmt does not work well with it. Also I can't set this to any value and set binpacking - not supported. | ||
# newlines.implicitParamListModifierForce = [after] # !!! TODO not sure | ||
newlines.afterInfix = keep | ||
newlines.afterInfixBreakOnNested = false # ??? https://scalameta.org/scalafmt/docs/configuration.html#newlinesafterinfixbreakonnested | ||
newlines.avoidForSimpleOverflow = [tooLong, punct, slc] | ||
newlines.avoidInResultType = true | ||
newlines.avoidAfterYield = false | ||
newlines.sometimesBeforeColonInMethodReturnType = false | ||
# newlines.beforeOpenParenDefnSite = keep # TODO not sure https://scalameta.org/scalafmt/docs/configuration.html#newlinesbeforeopenparenxxxsite | ||
# newlines.beforeOpenParenCallSite = keep # TODO only supported for Scala 3. Also, not sure... https://scalameta.org/scalafmt/docs/configuration.html#newlinesbeforeopenparenxxxsite | ||
newlines.selectChains = keep | ||
newlines.inInterpolation = avoid # TODO not sure https://scalameta.org/scalafmt/docs/configuration.html#newlinesininterpolation | ||
newlines.ignoreInSyntax = true # TODO very not sure https://scalameta.org/scalafmt/docs/configuration.html#newlinesignoreinsyntax | ||
|
||
optIn.annotationNewlines = true # TODO not sure https://scalameta.org/scalafmt/docs/configuration.html#optinannotationnewlines | ||
|
||
danglingParentheses.defnSite = true | ||
danglingParentheses.callSite = true | ||
danglingParentheses.bracketDefnSite = true | ||
danglingParentheses.bracketCallSite = true | ||
danglingParentheses.ctrlSite = true | ||
danglingParentheses.tupleSite = true | ||
danglingParentheses.exclude = [] # TODO not sure https://scalameta.org/scalafmt/docs/configuration.html#danglingparenthesesexclude | ||
# !!! TODO not sure how !!! newlines.configStyleXxxSite.prefer https://scalameta.org/scalafmt/docs/configuration.html#newlinesconfigstylexxxsiteprefer | ||
|
||
# prefercurlyfors, redundantparens, redundantbraces, sortmodifiers, sortimports, expandimportselectors, imports, avoidinfix, asciisortimports | ||
|
||
rewrite.rules = [SortModifiers, PreferCurlyFors, Imports] | ||
# rewrite.sortModifiers.preset = styleGuide # TODO consider removing (changes position of `final` keyword) https://scalameta.org/scalafmt/docs/configuration.html#sortmodifiers | ||
rewrite.sortModifiers.order = [ # TODO maybe a custom order... | ||
"final", "override", | ||
"implicit", | ||
"sealed", "abstract", | ||
"private", "protected", | ||
"lazy" | ||
] | ||
rewrite.preferCurlyFors.removeTrailingSemicolonsOnly = true # TODO not sure https://scalameta.org/scalafmt/docs/configuration.html#prefercurlyfors | ||
rewrite.imports.expand = false | ||
rewrite.imports.sort = scalastyle # TODO not sure - change this later https://scalameta.org/scalafmt/docs/configuration.html#imports-sort--ascii | ||
rewrite.imports.groups = [ # TODO not sure | ||
[".*"], # Other imports first | ||
["java\\..*", "scala\\..*", "scala.scalajs\\..*"] | ||
] | ||
rewrite.imports.contiguousGroups = only # TODO not sure | ||
rewrite.trailingCommas.style = keep # TODO consider changing to `never` | ||
rewrite.trailingCommas.allowFolding = true # TODO not sure https://scalameta.org/scalafmt/docs/configuration.html#rewritetrailingcommasallowfolding | ||
|
||
# TODO Scala 3 rewrites? https://scalameta.org/scalafmt/docs/configuration.html#scala3-rewrites | ||
|
||
# !!!! TODO not sure about any of this !!! Maybe disable completely? | ||
# https://scalameta.org/scalafmt/docs/configuration.html#vertical-multiline | ||
verticalMultiline.atDefnSite = true | ||
verticalMultiline.arityThreshold = 10 | ||
verticalMultiline.newlineAfterOpenParen = true | ||
|
||
comments.wrap = no | ||
comments.wrapStandaloneSlcAsSlc = true // # TODO not sure because unused | ||
comments.wrapSingleLineMlcAsSlc = false | ||
|
||
docstrings.style = keep # !!! TODO not sure, can also be Space, SpaceAsterisk, or AsteriskSpace https://scalameta.org/scalafmt/docs/configuration.html#docstringsstyle | ||
docstrings.removeEmpty = true | ||
docstrings.oneline = keep # TODO not sure. Note: Ignored if docstrings.style = keep https://scalameta.org/scalafmt/docs/configuration.html#docstringsoneline | ||
docstrings.wrap = keep | ||
docstrings.wrapMaxColumn = 100 # TODO change if want it to be different from maxColumn | ||
docstrings.blankFirstLine = keep # !!! TODO not sure, try `fold` | ||
docstrings.forceBlankLineBefore = false # TODO not sure https://scalameta.org/scalafmt/docs/configuration.html#docstringsforceblanklinebefore | ||
|
||
spaces.beforeContextBoundColon = never # !!! TODO not sure, Always or IfMultipleBounds may be better style https://scalameta.org/scalafmt/docs/configuration.html#spacesbeforecontextboundcolon | ||
spaces.inImportCurlyBraces = false | ||
spaces.inInterpolatedStringCurlyBraces = false | ||
spaces.inParentheses = false | ||
spaces.neverAroundInfixTypes = [] | ||
spaces.aroundSymbolicInfixOperators.include = [".*"] | ||
spaces.aroundSymbolicInfixOperators.exclude = [] | ||
spaces.afterKeywordBeforeParen = true | ||
spaces.inByNameTypes = true | ||
spaces.afterSymbolicDefs = false | ||
spaces.beforeApplyArgInParens = AfterSymbolic # TODO not sure https://scalameta.org/scalafmt/docs/configuration.html#spacesbeforexxxarginparens | ||
spaces.beforeInfixArgInParens = always | ||
spaces.afterColonInMatchPattern = always | ||
|
||
literals.long = Upper | ||
literals.float = Lower | ||
literals.double = Lower | ||
literals.hexPrefix = Lower | ||
literals.hexDigits = Lower # Not sure, unused https://scalameta.org/scalafmt/docs/configuration.html#literalshexdigits | ||
literals.scientific = Lower | ||
|
||
xmlLiterals.assumeFormatted = false | ||
|
||
# !!! TODO Classic select chains !!! https://scalameta.org/scalafmt/docs/configuration.html#classic-select-chains | ||
# - I don't think this applies to us, it's only for when newlines.source = classic, but we have `keep` | ||
|
||
# lineEndings = unix # TODO: Is there a difference between omitting it and setting `unix`? https://scalameta.org/scalafmt/docs/configuration.html#lineendings | ||
|
||
rewriteTokens = { | ||
"⇒": "=>" | ||
"→": "->" | ||
"←": "<-" | ||
} | ||
|
||
importSelectors = binPack # TODO Not sure, is there a `keep` option? https://scalameta.org/scalafmt/docs/configuration.html#importselectors |
This file contains bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
This file contains bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
This file contains bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
Original file line number | Diff line number | Diff line change |
---|---|---|
@@ -1 +1 @@ | ||
sbt.version = 1.9.7 | ||
sbt.version = 1.10.3 |
This file contains bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
Original file line number | Diff line number | Diff line change |
---|---|---|
@@ -0,0 +1,5 @@ | ||
// #Note this is /project/build.sbt – see /build.sbt for the main build config. | ||
|
||
libraryDependencies ++= Seq( | ||
"com.raquo" %% "buildkit" % ProjectVersions.BuildKit, | ||
) |
This file contains bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
Original file line number | Diff line number | Diff line change |
---|---|---|
@@ -0,0 +1,4 @@ | ||
object ProjectVersions { | ||
|
||
val BuildKit: String = "0.1.0" | ||
} |
This file contains bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
Original file line number | Diff line number | Diff line change |
---|---|---|
@@ -0,0 +1 @@ | ||
sbt.version = 1.10.3 |
This file contains bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
Original file line number | Diff line number | Diff line change |
---|---|---|
|
@@ -110,3 +110,4 @@ class TupleSignal9[T1, T2, T3, T4, T5, T6, T7, T8, T9](val signal: Signal[(T1, T | |
} | ||
|
||
// -- | ||
|
This file contains bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
Original file line number | Diff line number | Diff line change |
---|---|---|
|
@@ -166,3 +166,4 @@ class TupleStream9[T1, T2, T3, T4, T5, T6, T7, T8, T9](val stream: EventStream[( | |
} | ||
|
||
// -- | ||
|