Releases: scalameta/scalafmt
Releases Β· scalameta/scalafmt
v3.5.0
Features
- FormatOps: handle
if
as if noelse
whenkeep
(#3176) @kitbellew - Router: improve source=fold format of for-yield (#3170) @kitbellew
- Scalameta: upgrade to v4.5.1 (#3164) @kitbellew
- this changes handling of infix types for scala3
- Router: check formatInfix using the infix tree (#3163) @kitbellew
- Indents: implement matchSite (#3126) @kitbellew
AvoidInfix improvements
- AvoidInfix: implement allowInfixInPlaceholderArg (#3152) @kitbellew
- AvoidInfix: don't match if LHS can't be wrapped (#3151) @kitbellew
- AvoidInfix: don't wrap LHS if already wrapped (#3149) @kitbellew
- AvoidInfix: don't match if RHS has placeholder (#3148) @kitbellew
- AvoidInfix: refactor, use
::
match (#3147) @kitbellew - AvoidInfix: extract isWrapped, checkMatchingInfix (#3146) @kitbellew
- AvoidInfix: consolidate placeholder tests, extend (#3145) @kitbellew
- Rewrite: use scalameta PlaceholderChecks (#3131) @kitbellew
Bug fixes
- Router: use PenalizeNewlines to avoidInResultType (#3157) @kitbellew
- Config: in dynamic, allow stable or actual version (#3155) @kitbellew
- FormatWriter: allow code without leading space (#3150) @kitbellew
- Router: properly align block interpolations, too (#3127) @kitbellew
Other changes
- BestFirstSearch: cosmetic, extract enqueue method (#3172) @kitbellew
- Router: put isInfixApp and match into one unapply (#3171) @kitbellew
- Configuration: mention parameters for visit limits (#3144) @kitbellew
- Issue template: force using latest version, CLI (#3143) @kitbellew
Dependency updates
- Scalameta: upgrade to v4.5.2 (#3179) @kitbellew
- Bump actions/checkout from 2 to 3 (#3177) @dependabot
- Bump actions/download-artifact from 2.1.0 to 3 (#3178) @dependabot
- Update sbt-scalajs-crossproject to 1.2.0 (#3167) @scala-steward
- Update sbt-native-packager to 1.9.9 (#3166) @scala-steward
- Update sbt-assembly to 1.2.0 (#3165) @scala-steward
- Update mdoc, sbt-mdoc to 2.3.1 (#3168) @scala-steward
- Update sbt-buildinfo to 0.11.0 (#3133) @scala-steward
- Update scalafmt-core to 3.4.3 (#3139) @scala-steward
- Update mdoc, sbt-mdoc to 2.3.0 (#3138) @scala-steward
- Update sbt-scalajs to 1.9.0 (#3136) @scala-steward
- Update typesafe:config to 1.4.2 (#3135) @scala-steward
- Update sbt-native-packager to 1.9.8 (#3134) @scala-steward
- Update sbt-assembly to 1.1.1 (#3132) @scala-steward
- Update sbt to 1.6.2 (#3137) @scala-steward
- Scalameta: upgrade to 4.5.0 (#3130) @kitbellew
v3.4.3
Bug fixes
- Router: no
inInterpolation=allow
if scala3if
(#3115) @kitbellew
Ammonite parsing
Uses the parser in scalameta instead of splitting scripts on /\n@ /
. Preserves multiple consecutive @
now.
- Scalafmt: use ammonite parser to handle scripts (#3120) @kitbellew
- FormatAssertions: use filename to convert to input (#3121) @kitbellew
- Scalameta: upgrade to 4.4.35 (#3119) @kitbellew
- TokenTraverser: remove unnecessary iterator (#3118) @kitbellew
- FormatTokens: remove special case for BOF/EOF (#3117) @kitbellew
- Rewrite: expect a method to convert to Input (#3116) @kitbellew
v3.4.2
Bug fixes
- Format{Ops,Writer}: fix trailing comment indent (#3112) @kitbellew
- FormatOps: fix parentCtors exclusion rule (#3111) @kitbellew
- TreeOps: adjust the followedBySelectOrApply logic (#3110) @kitbellew
v3.4.1
Features
- CliArgParser: allow additional values for --mode (#3108) @kitbellew
- FormatOps: improve binpacking parentConstructors (#3094) @kitbellew
Bug fixes
- RedundantParens: check for placeholder in Apply (#3107) @kitbellew
- TreeOps: bugfix matching wrong type (#3102) @kitbellew
- Newlines: bugfix comparing wrong types (#3101) @kitbellew
- State: correctly compute line widths in strings and interpolations with strip margin (#3095) @kitbellew
- Router: use
early
to findwith
afterextends
(#3097) @kitbellew - Router: set interpolation indents correctly (#3092) @kitbellew
- Newlines: fully deprecate topLevelStatements (#3089) @kitbellew
Other changes
- Use Seq.newBuilder or prepend to get constant time (#3106) @kitbellew
- Implement changes from Intellij Code Inspection (#3104) @kitbellew
- MacroBenchmark: use Scalafmt.format vs formatCode (#3103) @kitbellew
- State: getColumns compute first line length once (#3096) @kitbellew
- State: refactor getColumnsWithStripMargin (cosmetic) (#3093) @kitbellew
- Tests: use assertEquals whenever possible (#3088) @kitbellew
Dependency updates
- Dependencies: update scalameta to v4.4.34 (#3109) @kitbellew
- Dependency: upgrade metaconfig to 0.10.0 (#3099) @kitbellew
v3.4.0
Features
- FormatOps: implement indentOperator.exemptScope (#3082) @kitbellew
- Router: implement newlines.inInterpolation logic (#3080) @kitbellew
- Add
docstrings.forceBlankLineBefore
, remove parameters deprecated before v3.0.0 (#3081) @kitbellew
Parameter changes
- added
indentOperator.exemptScope
- replaces removed
unindentTopLevelOperators
(true
->all
,false
->oldTopLevel
) - replaces deprecated
indentOperator.topLevelOnly
(true
->oldTopLevel
,false
->all
)
- replaces removed
docstrings.forceBlankLineBefore
- replaces removed
optIn.blankLineBeforeDocstring
- replaces deprecated
optIn.forceBlankLineBeforeDocstring
- replaces removed
newlines.inInterpolation
- removed
newlines.alwaysBeforeCurlyBraceLambdaParams
- use
newlines.beforeCurlyLambdaParams = always/never
- use
verticalMultiline.newline{Before,After}ImplicitKW
- use
newlines.implicitParamListModifierForce=[{before,after}]
- use
verticalMultiline.excludeDanglingParens
- use
danglingParentheses.exclude
- use
Bug fixes
- Preserve indentation inside codeblocks (#3084) @dos65
- Router: keep
case if
newline if source=keep (#3085) @kitbellew - Router: keep newline after
if
if source=keep (#3083) @kitbellew
Other changes
- ScalafmtConfigTest: move to config sub-package (#3087) @kitbellew
- ConfError.message: replace with Configured.error (#3086) @kitbellew
- Switch formatting to 3.3.3 (#3077) @kitbellew
- Installation: update package sizes as of 2022 (#3078) @kitbellew
- Add tests for end markers around comments (#3076) @kitbellew
v3.3.3
Bug fixes
- Router: disallow breaks in args in binpack=oneline (#3067) @kitbellew
- FormatWriter: idempotent wrapSingleLineMlcAsSlc (#3068) @kitbellew
Other changes
- Documentation: remove claim about default version (#3069) @kitbellew
Dependency updates
- Update sbt-scalafmt to 2.4.6 (#3075) @scala-steward
- Update scalatags to 0.11.1 (#3072) @scala-steward
- Update sbt to 1.6.1 (#3074) @scala-steward
- Update scala-library, scala-reflect to 2.13.8 (#3073) @scala-steward
v3.3.2
Features
- Router: implement
align.beforeOpenParenXxxSite
(#3052) @kitbellew - FormatWriter: in SLC, insert space before non-
/
(#3051) @kitbellew - RedundantBraces: add noParams option to defnBodies (#3031) @kitbellew
Format scala3 while-do/if-then/for-do consistently
- Router: handle
for-do/yield
the same aswhile
(#3050) @kitbellew - FormatOps: unfold yield correctly and consistently (#3047) @kitbellew
- Router: preserve break after
while
ifkeep
(#3049) @kitbellew - Router: handle then and do similar to else/yield (#3037) @kitbellew
- FormatOps: use Option in indentAndBreakBeforeCtrl (#3048) @kitbellew
Scaladoc with embedded elements
- Scalameta: upgrade to 4.4.32 (scaladoc fixes) (#3054) @kitbellew
- FormatWriter: refactor scaladoc formatting, escape text a-la code fence (#3036) @kitbellew
- FormatWriter: do not start "```" on top line (part 7) (#3046) @kitbellew
- FormatWriter: pass indent parameter to scaladoc (part 6) (#3045) @kitbellew
- FormatWriter: reuse scaladoc formatTextAfterMargin (part 5) (#3044) @kitbellew
- FormatWriter: refactor formatting a code block (part 4) (#3043) @kitbellew
- FormatWriter: extract logic to terminate a MLC (part 3) (#3042) @kitbellew
- FormatWriter: remove appendWithMargin for scaladoc (part 2) (#3041) @kitbellew
- FormatWriter: refactor, extract Scaladoc format (part 1) (#3040) @kitbellew
Bug fixes
- Scalameta: upgrade to 4.4.33 (scala3 comment fix) (#3064) @kitbellew
- Router: observe source=keep even when binpacking (#3065) @kitbellew
- StyleMap: fix style.binPack.literalsMinArgCount (#3062) @kitbellew
- FormatOps: bugfixes to deal with ephemeral single-stat blocks with trailing comments (#3058) @kitbellew
- Router: indent, handle comma in repeated enum cases (#3057) @kitbellew
- Router: if format:off and NL, keep only NL splits (#3029) @kitbellew
Other changes
- StyleMap: include
new
as a simple literal expr (#3060) @kitbellew - Documentation: describe all literal arglist params (#3061) @kitbellew
- FileOps: support symlinked files or directories (#3055) @kitbellew
- Installation: clarify sbt plugin version (#3039) @kitbellew
- ScalafmtConfig: simplify check for beforeMultiline (#3038) @kitbellew
- RedundantBraces: rename some parameters, amend documentation (#3030) @kitbellew
- HasTests: avoid NPE for incomplete formatting (#3028) @kitbellew
v3.3.1
Features
- FormatOps: ignore end marker for ctrl body purpose (#3023) @kitbellew
- RedundantBraces: rewrite
val
/var
/macro
, too (#3022) @kitbellew - FormatWriter: replace single-line mlc with slc (#2997) @kitbellew
Comment handling fixes
- Router: treat multi-line comment before NL as SLC (#3016) @kitbellew
- Router: do not attach comma after a comment (#3003) @kitbellew
- Router: attach/detach comment to comma as needed (#3002) @kitbellew
- Split: centralize noIndent handling (#3000) @kitbellew
- Router: do not detach or attach comment to comma (#2995) @kitbellew
Binpack handling fixes
- Router: binpack defn single-line to avoid overflow (#3010) @kitbellew
- Router: apply infix indent for single-arg binpack (#2996) @kitbellew
- Router: fix the indentCallSiteOnce functionality (#2994) @kitbellew
Rewrite safety fixes
- FormatOps: get rewritten tree head and last safer (#3020) @kitbellew
- FormatTokens: use to access tree head/last tokens (#3017) @kitbellew
Overflow fixes
- State: keep explicit penalty to detect overflow (#3014) @kitbellew
- BestFirstSearch: improve active overflow detection (#3012) @kitbellew
- State: fix overflow of trailing comments (#3011) @kitbellew
Other bug fixes
- FormatOps: remove empty outer blocks in ctrl body (#3021) @kitbellew
- FormatOps: consider infix case body as top level (#3018) @kitbellew
- Router: fix for-do like while-do before (#3015) @kitbellew
- FormatWriter: fix indentation detection logic (#3008) @kitbellew
- FormatOps: fix optional braces in
if/while
cond (#3007) @kitbellew - Router: check for syntax newlines in case SLB (#3004) @kitbellew
- FormatOps: in getApplyArgs, recognize infix rhs (#3001) @kitbellew
Other changes
- Bump actions/download-artifact from 2.0.10 to 2.1.0 (#3025) @dependabot
- FormatOps: set space/newline splits on diff lines (#3019) @kitbellew
- PolicyOps: create types of forced-break policies (#3009) @kitbellew
- FormatOps: swtich to the shorthand T for Token (#2999) @kitbellew
- Decision: centralize filtering newline splits (#2998) @kitbellew
- Documentation: add new
sbt-scalafmt
parameters (#2989) @kitbellew
v3.3.0
Pull Requests
- State: don't waive comment overflow for binPack (#2993) @kitbellew
- Router: do not skip indent if binpacking an infix (#2992) @kitbellew
- Router: find a less aggressive end of binpack arg (#2991) @kitbellew
- State: import symbols from TreeOps directly (#2990) @kitbellew
- Router: another fix to break on wrong
} catch
(#2988) @kitbellew
v3.2.2
Features
- Documentation: note binpack/dangling if !cfgstyle (#2985) @kitbellew
- Router: use dangle for binPack when not cfgstyle (#2979) @kitbellew
- Router: use danglingParens for assign and src=keep (#2966) @kitbellew
- ScalafmtConfig: set default infix exclude for sbt (#2964) @kitbellew
- Router: handle !annotationNewlines for source=keep (#2961) @kitbellew
- FormatWriter: add braces if span exceeds threshold (#2953) @kitbellew
- AlignToken: include
EnumCase
forextends
(#2957) @kitbellew - FormatWriter: format
@usecase
tag on one line (#2944) @kitbellew - GitOps: do not mask exceptions, propagate instead (#2943) @kitbellew
Fixes
- Router: indent comment before select chain break (#2986) @kitbellew
- TreeExtractors: use Type.Apply in Type.With chain (#2984) @kitbellew
- FormatWriter: fix column when wrapping comments (#2978) @kitbellew
- scala3 rewrite: do not rewrite _* unless bind (#2975) @kitbellew
- Router: keep rhsOptimalToken within Term.Apply (#2974) @kitbellew
- Router: don't indent binPack single-arg assign (#2967) @kitbellew
- FormatWriter: fix alignment for incorrect
//
pos (#2959) @kitbellew - FormatWriter: ignore mods to align definitions (#2958) @kitbellew
- Router: break before catch/finally on wrong brace (#2954) @kitbellew
- Router: handle
for { ... } expr
(#2952) @kitbellew - FormatOps: single-line infix until op, not lhs (#2951) @kitbellew
- Router: add indent to for-yield with comments (#2948) @kitbellew
- Router: handle try/catch/finally without braces (#2947) @kitbellew
- FormatOps: keep newline after comment in body (#2949) @kitbellew
- InputMethod: original string could be empty (#2941) @kitbellew
Other changes
- ScalafmtConfig: no dangling parens for scala.js (#2976) @kitbellew
- DanglingParentheses: obtain tuple or call site (#2973) @kitbellew
- DanglingParentheses: use shortcut values (#2970) @kitbellew
- Router: partial undo on: penalize newlines last (#2968) @kitbellew
- Router: penalize newlines last, after forcing one (#2965) @kitbellew
- PolicyOps: move some policies from FormatOps (#2963) @kitbellew
- ScalafmtDynamicError: somewhat clarify messages (#2960) @kitbellew
- FormatWriter: minor refactor in alignment code (#2956) @kitbellew
- RewriteScala3Settings: minor refactor, add default (#2945) @kitbellew
- FormatWriter: mark removed locations differently (#2942) @kitbellew
- sbt-scalafmt docs: describe
scalafmtFilter
(#2937) @kitbellew
Dependencies
- Update scalatags to 0.11.0 (#2980) @scala-steward
- Update sbt-scalajs to 1.8.0 (#2981) @scala-steward
- Update sbt to 1.5.8 (#2982) @scala-steward
- Update sbt-scalafmt to 2.4.5 (#2983) @scala-steward
- Dependencies: update scalameta to v4.4.31 (#2946) @kitbellew