Releases: scalameta/scalafmt
Releases · scalameta/scalafmt
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
v3.2.1
Pull Requests
- ScalafmtSession: add formatOrError() (#2939) @kitbellew
- ScalafmtReflect: replace format() with tryFormat() (#2938) @kitbellew
v3.2.0
Features
- ScalafmtConfig: allow
fileOverride
shortcuts, set cross-build dialects (#2902) @kitbellew
Intellij plugin updates in scalafmt-dynamic
To enable Intellij
to use the package rather than have its own legacy copy.
- ScalafmtDynamic: use dependency injection (#2925) @kitbellew
- ScalafmtReflectConfig: fix withoutRewriteRules (#2923) @kitbellew
- ScalafmtReflectConfig: refactor withoutRewriteRules (#2927) @kitbellew
- DynamicSuite: prepare to test more recent versions (#2926) @kitbellew
- ReflectionException: add flatten() method (#2922) @kitbellew
- ScalafmtReporter: use ScalafmtException to wrap (#2920) @kitbellew
- ScalafmtReflectConfig: add access to indents (#2919) @kitbellew
- ScalafmtConfig: add methods to detect rewrites (#2909) @kitbellew
- ScalafmtReflectConfig: add the getVersion method (#2904) @kitbellew
sbt-scalafmt
plugin updates in scalafmt-dynamic
and scalafmt-sysops
- FileOps: move getFileMatcher from dynamic runner (#2934) @kitbellew
- GitOps: change to operate on multiple dirs (#2930) @kitbellew
- ScalafmtSession: add check for git constraint (#2928) @kitbellew
- ScalafmtDynamicRunner: remove custom session class (#2907) @kitbellew
- ScalafmtReflect: use version to choose right call (#2905) @kitbellew
- Interfaces: create session in main Scalafmt trait (#2903) @kitbellew
Other changes
- BatchFileMode: move file search logic from GitOps (#2935) @kitbellew
- GitOps: remove workingDirectory field (#2933) @kitbellew
- CliOptions: expose workingDirectory only in outer (#2932) @kitbellew
- ScalafmtRunner: filter Path not AbsoluteFile (#2931) @kitbellew
- FileOps: allow filtering by basic file attributes (#2929) @kitbellew
- ScalafmtVersion: support dynver snapshots (#2924) @kitbellew
- ScalafmtDynamic: fix handling of .md files (#2918) @kitbellew
- ScalafmtDynamic: refactor tryFormat (#2912) @kitbellew
- ScalafmtDynamic: inline ignore check (#2911) @kitbellew
- ScalafmtReflectConfig: extract matcher as field (#2910) @kitbellew
- CliTest: assert exit code (#2906) @kitbellew
Dependency upgrades
- Update sbt-native-packager to 1.9.7 (#2913) @scala-steward
- Update scala-library, scala-reflect to 2.13.7 (#2914) @scala-steward
- Update sbt-scalafmt to 2.4.4 (#2915) @scala-steward
- Update scalameta, testkit to 4.4.30 (#2917) @scala-steward
v3.1.2
Pull Requests
- ScalafmtRunner: extract Dialect as NamedDialect (#2901) @kitbellew
- ScalafmtConfig: cosmetic, import companion object (#2900) @kitbellew
- ScalafmtConfig: getConfigFor returns Try, uses AbsoluteFile (#2899) @kitbellew
- Changelog: refer to the github releases page (#2898) @kitbellew
- Documentation: describe
optIn.annotationNewlines
(#2896) @kitbellew - FormatWriter: bug fix when computing nest (#2893) @kitbellew
- Newlines.topLevelStatementBlankLines: add minNest (#2892) @kitbellew
- FormatWriter: cosmetic, reformat Traverser (#2891) @kitbellew
- DynamicSuite: use previous stable instead (#2889) @kitbellew
v3.1.1
Bug fixes
- ScalafmtDynamic: download even current build (#2883) @kitbellew
Pull Requests
- ScalafmtDynamicDownloader: get -core, not -cli (#2887) @kitbellew
- scalafmt-dynamic: move tests into the module (#2884) @kitbellew
- DynamicSuite: use latest stable build as "latest" (#2885) @kitbellew
- Workflows: be sure to fetch tags with --unshallow (#2886) @kitbellew
- Use a lower case for runner dialects in the error message (#2881) @danicheg
- ConfParsed: extract metaconfig logic from core into new module (#2880) @kitbellew
v3.1.0
Pull Requests: required version and dialect
The version
and runner.dialect
fields are now required in scalafmt configuration.
- Cli: print the type of scalafmt runner for debug (#2879) @kitbellew
- ScalafmtConfig: do not read version from a preset (#2875) @kitbellew
- Cli: make sure version is explicitly specified (#2873) @kitbellew
- ScalafmtConfig: require
version
in a config file (#2843) @kitbellew - ScalafmtDynamic: use real build version as current (#2839) @kitbellew
- Scalafmt: make explicit dialect a required field (#2835) @kitbellew
- ScalafmtVersion: remove unused group from regex (#2836) @kitbellew
Pull Requests: move {File,Git}Ops into sysops package
Various file and git utilities have been moved to the new scalafmt-sysops
package.
- MicroBenchmark: use the right package for FileOps (#2876) @kitbellew
- scalafmt-sysops: add a new module (#2871) @kitbellew
- GitOps: move finding config file and files to format (#2849) @kitbellew
- GitOps: define a factory trait to construct (#2848) @kitbellew
Pull Requests: use nio.Path instead of io.File
- FileOps: read from files and URLs separately (#2872) @kitbellew
- FileOps: implement listFiles using Files.find (#2860) @kitbellew
- FileOps: split .getFile into separate methods (#2870) @kitbellew
- InputMethod: use nio.Path instead of String (#2869) @kitbellew
- AbsoluteFile: use nio.Path instead of io.File (#2867) @kitbellew
- AbsoluteFile: define isDirectory/mkdir/delete (#2866) @kitbellew
- AbsoluteFile: add apply and conditional from (#2865) @kitbellew
- AbsoluteFile: avoid using .jfile (#2864) @kitbellew
- Absolute: use .path instead of .jfile.toPath (#2863) @kitbellew
- AbsoluteFile: .path returns Path, .toString returns String (#2862) @kitbellew
- FileOps: implement listFiles to return Seq[Path] (#2861) @kitbellew
- AbsoluteFile: turn into a final class (#2853) @kitbellew
- AbsoluteFile: move some methods from FileOps (#2859) @kitbellew
- AbsoluteFile: remove fromFile (#2858) @kitbellew
- FileOps: isRegularFile takes nio.Path, not io.File (#2857) @kitbellew
- FileOps: getFile returns nio.Path, not io.File (#2856) @kitbellew
- CliOptions: use nio.Path instead of io.File (#2855) @kitbellew
- FileOps: read/write using nio.Path (#2854) @kitbellew
- Config: use nio.Path instead of io.File (#2851) @kitbellew
Pull Requests: other
- Router: fix idempotence of wrapped short comments (#2877) @kitbellew
- TokenMeta: add convenience check hasNL (#2878) @kitbellew
- RedundantBraces: insert
=
if removing{
in secondary ctor with procedure syntax (#2874) @kitbellew - Remove unused code (#2868) @kitbellew
- ScalaFile: remove, unused (#2852) @kitbellew
- ScalafmtReflect: don't pass classloader to Config (#2844) @kitbellew
- IndentOperator: rename
include
toincludeRegex
(#2841) @kitbellew - Config: remove unused path parameter to fromConf (#2838) @kitbellew
- ScalafmtDynamic: add config path to unknown errors (#2837) @kitbellew