Releases: scalameta/scalafmt
Releases Β· scalameta/scalafmt
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
v3.0.8
Pull Requests
- Documentation: describe
importSelectors
(#2833) @kitbellew - Add scalameta logo as favicon (#2831) @mlachkar
- #2830 Add Term.New check to AvoidInfix (#2832) @DutchDestroyer
- FormatWriter: ensure space in single-line comments (#2828) @kitbellew
- FormatWriter: do not wrap commented-out code (#2827) @kitbellew
- Router: fold single-line case arrow body if unfold (#2826) @kitbellew
- Fix afterCurlyLambdaParams=keep with source=fold (#2825) @kitbellew
- Explain limitations of newlines.afterCurlyLambdaParams (#2824) @tgodzik
Dependency updates
- Update sbt-scalajs to 1.7.1 (#2814) @scala-steward
- Update sbt-native-packager to 1.9.0 (#2813) @scala-steward
- Update sbt-native-image to 0.3.2 (#2817) @scala-steward
- Update scala-parallel-collections to 1.0.4 (#2815) @scala-steward
- Update mdoc, sbt-mdoc to 2.2.24 (#2816) @scala-steward
- Update sbt-mima-plugin to 1.0.1 (#2812) @scala-steward
- Update scalatags to 0.10.0 (#2811) @scala-steward
- Update sbt-ci-release to 1.5.10 (#2810) @scala-steward
- Update scalafmt-core to 3.0.7 (#2818) @scala-steward
- Updating dockerize CI step to properly use docker/metadata-action instead of generating tags with shell cmnds (#2808) @jmherbst
v3.0.7
Pull Requests
- Imports: apply indent of first import to a group (#2804) @kitbellew
- Correcting dockerize job to run when a release is created (#2800) @jmherbst
- Dependency: update scalameta to 4.4.29 (#2806) @kitbellew
- Dependency: update metaconfig to 0.9.15 (#2805) @kitbellew
- FormatOps: optional braces after old-style loops (#2803) @kitbellew
- FormatOps: use unapply match for optional braces 2 (#2802) @kitbellew
- TreeOps: add method to check for multi sequences (#2799) @kitbellew
- FormatOps: use unapply match for optional braces (#2798) @kitbellew
- FormatOps: explicit
while
for optional braces (#2797) @kitbellew - FormatOps: opt braces for significant indent only (#2795) @kitbellew
- RedundantBraces: handle body of secondary ctor (#2796) @kitbellew
- Scala3: does not support do-while, remove logic (#2792) @kitbellew
- FormatWriter: other counting of end marker lines (#2789) @kitbellew