Update scalafmt-core to 3.11.0#2329
Conversation
There was a problem hiding this comment.
Code Review
This pull request primarily focuses on reformatting the codebase using scalafmt 3.11.0 and applying various code style improvements, such as better line breaking and formatting of complex expressions. The review comments provided highlight opportunities to improve the construction of Doc objects by using combinators instead of string interpolation, which is a good practice for performance and formatting consistency.
| s"type mismatch in call to $fnLabel, argument ${appSite.argIndex + 1} of ${appSite.argCount}:" | ||
| ) + Doc.hardLine + | ||
| Doc.text("expected: ") + tmap( |
There was a problem hiding this comment.
When the final output is a Doc object, use Doc combinators directly for construction instead of intermediate string concatenation. This avoids unnecessary intermediate string allocations and leverages the library's ability to handle formatting more efficiently.
| s"type mismatch in call to $fnLabel, argument ${appSite.argIndex + 1} of ${appSite.argCount}:" | |
| ) + Doc.hardLine + | |
| Doc.text("expected: ") + tmap( | |
| Doc.text("type mismatch in call to ") + Doc.text(fnLabel) + Doc.text(", argument ") + Doc.text((appSite.argIndex + 1).toString) + Doc.text(" of ") + Doc.text(appSite.argCount.toString) + Doc.text(":") + Doc.hardLine + |
References
- When the final output is a
Docobject, useDoccombinators directly for construction instead of intermediate string concatenation.
| Doc.text("pattern type mismatch:") + Doc.hardLine + | ||
| Doc.text("pattern: ") + Doc.text( | ||
| patternDoc |
There was a problem hiding this comment.
When the final output is a Doc object, use Doc combinators directly for construction instead of intermediate string concatenation. Here, patternDoc is a String that was likely constructed via render or similar; if possible, pass the underlying Doc or use combinators to build this section.
Doc.text("pattern type mismatch:") + Doc.hardLine +
Doc.text("pattern: ") + Doc.text(patternDoc) + Doc.hardLine +References
- When the final output is a
Docobject, useDoccombinators directly for construction instead of intermediate string concatenation.
| Doc.text("the type ") + tmap(tpe) + Doc.text( | ||
| " is not polymorphic enough" | ||
| ) + Doc.hardLine + context |
There was a problem hiding this comment.
When the final output is a Doc object, use Doc combinators directly for construction instead of intermediate string concatenation.
Doc.text("the type ") + tmap(tpe) + Doc.text(" is not polymorphic enough") + Doc.hardLine + contextReferences
- When the final output is a
Docobject, useDoccombinators directly for construction instead of intermediate string concatenation.
Codecov Report❌ Patch coverage is Additional details and impacted files@@ Coverage Diff @@
## main #2329 +/- ##
==========================================
+ Coverage 85.14% 85.20% +0.06%
==========================================
Files 196 196
Lines 49379 49916 +537
Branches 12196 12272 +76
==========================================
+ Hits 42042 42531 +489
- Misses 7337 7385 +48 ☔ View full report in Codecov by Sentry. 🚀 New features to boost your workflow:
|
4e23d0a to
6c346d8
Compare
6c346d8 to
fea410d
Compare
Executed command: scalafmt --non-interactive
fea410d to
14b1fbf
Compare
|
Superseded by |
About this PR
📦 Updates org.scalameta:scalafmt-core from
3.10.7to3.11.0📜 GitHub Release Notes - Version Diff
Usage
✅ Please merge!
I'll automatically update this PR to resolve conflicts as long as you don't change it yourself.
If you'd like to skip this version, you can just close this PR. If you have any feedback, just mention me in the comments below.
Configure Scala Steward for your repository with a
.scala-steward.conffile.Have a fantastic day writing Scala!
🔍 Files still referring to the old version number
The following files still refer to the old version number (3.10.7).
You might want to review and update them manually.
⚙ Adjust future updates
Add this to your
.scala-steward.conffile to ignore future updates of this dependency:Or, add this to slow down future updates of this dependency: