chipsalliance / chipsalliance/chisel

Bump Scalafmt

Open
#3,996 1 comment 0 reactions 0 assignees View on GitHub
Dominant language
Scala
Stars
4.8k
Forks
658
Avg merge
18h 59m
Merged PRs (30d)
14

Description

**Type of issue**: Feature Request

Old Scalafmt will has some parsing issues, see #3992.
We need to upgrade it, but seems it is not compatible, we may need to reformat the entire code base...

**Is your feature request related to a problem? Please describe.**
```
diff --git a/.scalafmt.conf b/.scalafmt.conf
index f74e55047..fa8413a3a 100644
--- a/.scalafmt.conf
+++ b/.scalafmt.conf
@@ -1,21 +1,21 @@
-version = 2.6.4
-
+version = 3.8.1
+runner.dialect = scala213
maxColumn = 120
-align = most
-continuationIndent.defnSite = 2
+align.preset = most
+indent.defnSite = 2
assumeStandardLibraryStripMargin = true
-docstrings = ScalaDoc
+docstrings.style = SpaceAsterisk
lineEndings = preserve
includeCurlyBraceInSelectChains = false
-danglingParentheses = true
+danglingParentheses.preset = true

-align.tokens.add = [
+align.tokens."+" = [
{
code = ":"
}
]

-newlines.alwaysBeforeCurlyBraceLambdaParams = false
+newlines.beforeCurlyLambdaParams = never
newlines.alwaysBeforeMultilineDef = false
newlines.implicitParamListModifierForce = [before]
```
Here is a straightforward change to scalafmt config, but seems new version of scalafmt is more aggressive.

Contributor guide

Open the contributing guide

Research direction

Start with .scalafmt.conf and the proposed Scalafmt 3.8.1 settings, then review issue #3992 for the parsing problems. Upgrade the formatter configuration, reformat the Scala codebase as needed, and verify that the resulting code remains compatible with the new version.

Written by the indexing model from the issue text.

Assessment

Tech stack
scala
Domain
tooling
Issue type
Feature
Difficulty
4/5
Estimated time
3-5 days
Activity status
Stale
Clarity
Mostly clear
Newbie friendliness
35/100

Get new issues in your inbox

A short digest of beginner-friendly GitHub issues.