-
-
Notifications
You must be signed in to change notification settings - Fork 4
Commit
This commit does not belong to any branch on this repository, and may belong to a fork outside of the repository.
Merge pull request #270 from mdedetrich/add-scalafix
Add scalafix
- Loading branch information
Showing
11 changed files
with
71 additions
and
32 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 |
---|---|---|
|
@@ -11,5 +11,7 @@ jobs: | |
- uses: actions/[email protected] | ||
with: | ||
fetch-depth: 0 | ||
- name: 'Linter: Scalafix checks' | ||
run: sbt "scalafixAll --check" | ||
- uses: olafurpg/setup-scala@v10 | ||
- run: sbt test scripted publishLocal |
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,30 @@ | ||
rules = [ | ||
DisableSyntax, # Disables some constructs that make no semantic sense like `final val` | ||
ProcedureSyntax, # Procedure syntax in Scala is always discouraged | ||
NoValInForComprehension, # `val` in for comprehensions are deprecated and shouldn't be used | ||
NoAutoTupling, # Avoids the automatic tupling in parameters | ||
RemoveUnused, # Removes unused elements | ||
LeakingImplicitClassVal, # This rule adds the private access modifier on the field of implicit value classes in order to prevent direct access. | ||
OrganizeImports # Organizes imports and removes unused ones | ||
] | ||
|
||
ExplicitResultTypes.memberKind = [Def, Val, Var] | ||
ExplicitResultTypes.memberVisibility = [Public, Protected] | ||
ExplicitResultTypes.skipSimpleDefinitions = ['Lit', 'Term.New', 'Term.Ref'] | ||
ExplicitResultTypes.fatalWarnings = true | ||
DisableSyntax.noReturns = true | ||
DisableSyntax.noWhileLoops = true | ||
DisableSyntax.noXml = true | ||
DisableSyntax.noFinalVal = true | ||
DisableSyntax.noFinalize = true | ||
DisableSyntax.noValPatterns = true | ||
RemoveUnused.imports = false # The plugin organize imports removes unused and clashes with this | ||
OrganizeImports { | ||
groupedImports = Merge | ||
groups = [ | ||
"*" | ||
"java." | ||
"scala." | ||
"re:javax?\\." | ||
] # Reasoning for this config is to keep the more business related imports at the top, while language imports are on the bottom | ||
} |
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
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
4 changes: 2 additions & 2 deletions
4
src/main/scala/net/bzzt/reproduciblebuilds/SbtLibraryManagementFunctions.scala
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