Releases: scalameta/scalafmt
v3.0.0-RC4
Pull Requests
- RedundantBraces: keep in macro quotes/splices (#2557) @kitbellew
- FormatOps: matchingOpt unless tok from FormatToken (#2556) @kitbellew
- [Scala 3] Add tests for indented curried params (#2553) @tgodzik
- Update scalameta to 4.4.19 (#2552) @tgodzik
- Update sbt-jmh to 0.4.2 (#2551) @scala-steward
- Update munit to 0.7.26 (#2550) @scala-steward
- Update mdoc, sbt-mdoc to 2.2.21 (#2549) @scala-steward
- Update scalacheck to 1.15.4 (#2548) @scala-steward
- Update sbt to 1.5.2 (#2547) @scala-steward
- Update scala-parallel-collections to 1.0.3 (#2545) @scala-steward
- Update scala-library, scala-reflect to 2.13.6 (#2544) @scala-steward
- Update sbt-mima-plugin to 0.9.2 (#2543) @scala-steward
- RedundantBraces: remove single-block-within-block (#2542) @kitbellew
- FormatTokens: informative message if token missing (#2541) @kitbellew
- AlignToken: add an optional
parent
pattern (#2540) @kitbellew - Trees: use .toString to get original input syntax (#2538) @kitbellew
- Make sure ExpandImportSelectors uses correct dialect (#2537) @tgodzik
- FormatOps: add optional braces after
package a:
(#2536) @kitbellew - FormatWriter: fix lineId computation for
BOF
(#2534) @kitbellew - FormatWriter: insert optional-braces end markers (#2533) @kitbellew
- FormatOps: refactor optional braces code, add owner of such region (#2532) @kitbellew
- ScalafmtConfig: switch to using ConfDecoderEx (#2528) @kitbellew
- ScalafmtParser: add an encodable parser wrapper (#2531) @kitbellew
- Configured: use new methods from metaconfig (#2530) @kitbellew
- Metaconfig: upgrade to v0.9.13 (#2529) @kitbellew
- RewriteScala3Settings: fix the decoder (#2527) @kitbellew
- FormatOps: fix forced newline for optional braces (#2526) @kitbellew
- BaseStyle: remove as unused (#2525) @kitbellew
- Display filename alongside line information when debugging (#2514) @tgodzik
- Make sure that lambda newlines are preserved under keep (#2520) @tgodzik
v3.0.0-RC3
Pull Requests
- Add dialect to allow formatting with -Xsource:3 option (#2516) @tgodzik
- Fix issues with QuotedMacroType (#2515) @tgodzik
- Update Scalameta to 4.4.18 (#2517) @tgodzik
- Fix indentation when using braceless block with single Defn (#2513) @tgodzik
- Add tests for #2480 (#2509) @tgodzik
- CliOptions: do not compute
cwd
at compile time (#2507) @kitbellew - Add tests for #2478 (#2508) @tgodzik
- ScalafmtRunner: remove dialect parsing hack (#2485) @kitbellew
- Remove optional braces in function blocks (#2504) @tgodzik
- Remove optional braces in extension groups (#2505) @tgodzik
- Add tests for removing optional braces in anonymous new (#2506) @tgodzik
- Scalameta: upgrade to 4.4.17 (#2503) @kitbellew
- Update link to Mill's new website (#2502) @amaalali
- FormatWriter: support scaladoc-embedded scala code (#2499) @kitbellew
- RedundantParens: support match, partial functions (#2497) @kitbellew
- FormatOps:
NoSuchElementException
for right brace (#2496) @kitbellew - [Scala 3] Allow to remove optional braces in type matches (#2494) @tgodzik
- Router: break before
then/do
in multilineif/while
(#2491) @kitbellew - FormatOps: fix leadingComment, ensure NL before it (#2492) @kitbellew
- FormatWriter: do not overflow when aligning (#2486) @kitbellew
- Documentation: describe
indent.significant
(#2490) @kitbellew - Bump docker/build-push-action from v2.3.0 to v2.4.0 (#2488) @dependabot
- Bump actions/download-artifact from v2.0.8 to v2.0.9 (#2487) @dependabot
- Newlines: define templateBody parameters (#2484) @kitbellew
- Add RedundantBraces import statements rewrite (#2483) @hugo-vrijswijk
- TokenOps: copy-paste error in findLastVisibleToken (#2482) @kitbellew
- Use only the last non-comment token for binpack expire (#2481) @tgodzik
- Fix deprecated sbt syntax (#2477) @tgodzik
v3.0.0-RC2
Pull Requests
- [Scala 3] Add test for typed patterns (#2476) @tgodzik
- Spaces: move SpaceBeforeContextBound as nested (#2474) @kitbellew
- CliOptions: fix warning, don't use ScalafmtRunner (#2475) @kitbellew
- FormatOps: use
keep
in binPackParentCtorSplits (#2452) @kitbellew - FormatOps: rename
tree
field totopSourceTree
(#2473) @kitbellew - ProjectFiles: rename include to includePaths (#2471) @kitbellew
- CliOptions: parse config into a Conf object (#2470) @kitbellew
- FormatTokensRewrite: migrate RedundantParen/Braces (#2469) @kitbellew
- FormatTokensRewrite: check right
(
in two rules (#2472) @kitbellew - FormatTokensRewrite: migrate PreferCurlyFors (#2467) @kitbellew
- CliOptions: use config defaults from source class (and other refactors) (#2466) @kitbellew
- Scala 2.12: use Single Abstract Method lambdas (#2468) @kitbellew
- FormatTokensRewrite: migrate RewriteTrailingCommas (#2465) @kitbellew
- Drop support for Scala 2.11 (#2464) @tgodzik
- FormatTokens: remove optional braces, rewrite to new syntax (#2419) @kitbellew
- FormatOps: optional braces in
= partial function
(#2463) @kitbellew - Update munit to 0.7.25 (#2460) @scala-steward
- Update scalameta to 4.4.15 (#2462) @tgodzik
- Update mdoc_2.12, mdoc_2.13, sbt-mdoc to 2.2.20 (#2459) @scala-steward
- Update sbt to 1.5.1 (#2458) @scala-steward
- Update scala-parallel-collections to 1.0.2 (#2457) @scala-steward
- Update sbt-scalajs to 1.5.1 (#2456) @scala-steward
- ProjectFiles: add
PathMatcher
patterns (#2453) @kitbellew - Documentation: point to ScalaFiddle, AST Explorer (#2454) @kitbellew
- TermDisplay: don't invoke tput if TERM is not set (#2455) @kitbellew
- Docstrings: change wrap default to yes (#2239) @kitbellew
- FormatOps: mimic
{}
pairs with optional braces (#2451) @kitbellew - Router: use
newlines.forceBeforeMultilineAssign
for enumerators (#2442) @kitbellew - TreeOps: remove extra match in isCaseBodyABlock (#2450) @kitbellew
- TreeOps: tail-recursive withChain (#2445) @kitbellew
- ValidationOps: add overload, remove param defaults (#2444) @kitbellew
- BinPack: support indenting call sites only once (#2438) @kitbellew
- FormatOps: keep source line for optional braces (#2443) @kitbellew
- Don't pass CMSClassUnloading to sbt (#2440) @raboof
- Fix formatting when Ident is after TypeLambdaArrow (#2439) @tgodzik
- StyleMap: use binary search on change positions (#2435) @kitbellew
- Router: handle and-or types using newlines.source (#2430) @kitbellew
- Router: use available style to check binpack (#2436) @kitbellew
- FormatOps: fix indent in
if
with optional braces (#2437) @kitbellew - Prepare for scala3 rewrites (new syntax, optional braces) (#2428) @kitbellew
- FormatOps: optional braces in a single-stat block (#2433) @kitbellew
- FormatOps: fix bug with
{
orthen
inif
(#2432) @kitbellew - Decodable: disable top-level presets, error out (#2431) @kitbellew
- FormatOps: bugfix with enclosed
(apply(x => y))
(#2427) @kitbellew - Rewrite: fix the placeholder check (#2429) @kitbellew
v3.0.0-RC1
Pull Requests
- FormatOps: support optional braces for
if (a)
(#2420) @kitbellew - Router: handle
then/else/do/try/finally
with optional braces (#2415) @kitbellew - BestFirstSearch: partially undo the last commit (#2418) @kitbellew
- Various changes to prepare to rewrite optional braces (#2416) @kitbellew
- Scalameta: upgrade to 4.4.13 fixing end val (#2414) @kitbellew
- FormatOps: find any ancestor of right as a block (#2413) @kitbellew
- Router: handle optional braces in this/catch/match/for-do/for-yield (#2411) @kitbellew
- Scalameta: upgrade to 4.4.12 fixing end match (#2412) @kitbellew
- Router: handle blank lines before optional braces (#2410) @kitbellew
- [Scala 3] Add support for optional braces (#2406) @kitbellew
- Router: use extractors on meta to get extra values (#2408) @kitbellew
- FormatOps: simplify looking for template "curly" (#2409) @kitbellew
- Router: force break before multiline assignments (#2404) @kitbellew
- Tests: apply header customizations for all tests (#2407) @kitbellew
- ScalafmtConfig: define a new
indent.main
parameter (#2401) @kitbellew - State: move format:off detection to FormatToken (#2397) @kitbellew
- Router: simplify and refactor
getSplitsValEquals
(#2403) @kitbellew - FormatOps: fix bug with space indent in ctrl body (#2402) @kitbellew
- Remove paiges, which doesn't seem to be used anymore (#2398) @tgodzik
- BFS: keep policies and indents for provided splits (#2396) @kitbellew
- Update scalameta to 4.4.11 (#2395) @tgodzik
- Newlines: explicit setting for beforeTypeBounds (
:
,<:
,>:
,<%
) (#2393) @kitbellew - Documentation: describe
importSelectors
(#2394) @kitbellew - Router: don't align
"( // comment"
(#2392) @kitbellew - Router: keep break for single-arg assign, dangling close (#2391) @kitbellew
- FormatWriter: make sure comments start with
"// "
(#2390) @kitbellew - Make patches easier to apply -- patch(1p) (#2389) @kitbellew
- State: don't overflow single-line interpolations (#2388) @kitbellew
- Update scalatags to 0.9.4 (#2387) @tgodzik
- Update scala-library, scala-reflect to 2.13.5 (#2382) @scala-steward
- Update scala-library, scala-reflect to 2.12.13 (#2381) @scala-steward
- [Scala 3] Add formatting for match used as an operator (#2386) @kitbellew
- Update scalatags to 0.9.4 (#2379) @scala-steward
- Update sbt to 1.4.9 (#2384) @scala-steward
- Update scala-parallel-collections to 1.0.1 (#2383) @scala-steward
- Update sbt-native-packager to 1.8.1 (#2380) @scala-steward
- Update sbt-ci-release to 1.5.7 (#2377) @scala-steward
- Update scopt to 4.0.1 (#2378) @scala-steward
- Documentation: reduce nesting, reword, caution on all defaults (#2375) @kitbellew
- RedundantBraces: keep around some new anonymous expressions with select (#2374) @kitbellew
- Documentation: docstring.style=keep since v3.0.0 (#2373) @kitbellew
- TokenTraverser: fix bug with traversing back (#2372) @kitbellew
- Config: allow "keep" where "preserve" is used (#2323) @kitbellew
- [Scala 3] Add formatting for derives clause (#2371) @tgodzik
- [Scala 3] Format import/export when using
as
soft keyword (#2366) @tgodzik - [Scala 3] Fix formatting for the new vararg splices (#2368) @tgodzik
- [Scala 3] Add tests for modified extension methods (#2369) @tgodzik
- [Scala 3] Add tests for new wildcard imports (#2367) @tgodzik
- Bump docker/build-push-action from v2.2.2 to v2.3.0 (#2364) @dependabot
- Fix compile errors due to scopt update (#2363) @tototoshi
- Update scalameta to 4.4.10 (#2362) @tgodzik
- Update munit to 0.7.22 (#2360) @scala-steward
- Update mdoc_2.12.12, mdoc_2.13, sbt-mdoc to 2.2.18 (#2359) @scala-steward
- Update sbt to 1.4.7 (#2358) @scala-steward
- Update sbt-scalajs to 1.5.0 (#2357) @scala-steward
- Spelling (#2354) @jsoref
- [Scala 3] Add tests for inline if and match support (#2353) @tgodzik
- [Scala 3] Add support for given definitions (#2332) @tgodzik
- [Scala 3] Allow enums to be aligned with classes, objects and traits (#2352) @tgodzik
- Update Scalameta to 4.4.8 and add formatting for type bounds (#2351) @tgodzik
- Fixed always false conditions (#2349) @poslegm
- Align case values (#2345) @arbitrary-dev
- Add spaces.inInterpolatedStringCurlyBraces (#2341) @arbitrary-dev
- Bump docker/build-push-action from v2.2.1 to v2.2.2 (#2347) @dependabot
- Bump actions/download-artifact from v2.0.7 to v2.0.8 (#2346) @dependabot
- [Scala 3] Add support for union and intersection types (#2340) @tgodzik
- [Scala 3] Add formatting for type lambdas (#2339) @tgodzik
- [Scala 3] Add formatting for polymorphic functions (#2338) @tgodzik
- [Scala 3] Add formatting for dependent function types (#2337) @tgodzik
- Update munit to 0.7.21 (#2336) @scala-steward
- Update mdoc, sbt-mdoc to 2.2.16 (#2335) @scala-steward
- Update sbt-scalajs to 1.4.0 (#2334) @scala-steward
- Update scalatags to 0.9.3 (#2333) @scala-steward
- [Scala 3] Add tests for given exports (#2331) @tgodzik
- [Scala 3] Add formatting for opaque types (#2330) @tgodzik
- [Scala 3] Format export clauses (#2329) @tgodzik
- Scala 3: given imports, pattern-bound givens (#2327) @michalbednarz
- Use recently added CaseTree instead of Tree for cases (#2314) @tgodzik
- [Scala 3] Allow to use commas instead of with for multiple parents (#2326) @tgodzik
- [Scala 3] Add infix modifier (#2325) @tgodzik
- [Scala3] Add inline and transparent modifiers (#2324) @tgodzik
- Scala 3: context functions (#2308) @michalbednarz
- Router: keep a blank between comma and comment (#2321) @kitbellew
- StyleMap: warn if rewrite settings are overridden (#2322) @kitbellew
- Add tests for macro pattern (#2316) @tgodzik
- Scala 3: add support for extension methods (#2298) @olafurpg
- [Scala 3] Add support for match types (#2309) @tgodzik
- Smaller improvements for tests and Scala 3 (#2312) @tgodzik
- Bump actions/download-artifact from v2.0.6 to v2.0.7 (#2311) @dependabot
- Bump docker/build-push-action from v2.2.0 to v2.2.1 (#2310) @dependabot
- Update scalameta, testkit to 4.4.4 (#2307) @scala-steward
- Update munit to 0.7.20 (#2306) @scala-steward
- Update mdoc, sbt-mdoc to 2.2.14 (#2305) @scala-steward
- Update scalacheck to 1.15.2 (#2304) @scala-steward
- Update sbt to 1.4.6 (#2303) @scala-steward
- Update sbt-native-packager to 1.8.0 (#2302) @scala-steward
- Update sbt-ci-release to 1.5.5 (#2300) @scala-steward
- Support using soft keyword in parameter and argument lists (#2284) @michalbednarz
- Add munit test framework to the codebase (#2294) @tgodzik
- [Scala 3] Add tests for formatting trait parameters, local type declaration and new type wildcard symbol (#2295) @tgodzik
- Add tests for windows (#2293) @tgodzik
- Fix Macros after fixes in scalameta (#2292) @tgodzik
- Scala 3: Implement support for quote and splice (#2286) @olafurpg
- Update scalameta to 4.4.2 (#2291) @tgodzik
- Support case with class constructor (#2283) @michalbednarz
- Upgrade dependencies (#2282) @olafurpg
- Support enum in dotty (#2262) @michalbednarz
- Bump docker/build-push-action from v2.1.0 to v2.2.0 (#2281) @dependabot
- revert #2272 #2277 (#2278) @poslegm
- Dedicated sbt sessions for release and docs publishing (#2277) @poslegm
- Update scalacheck to 1.15.1 (#2273) @scala-steward
- Update sbt to 1.4.4 (#2272) @scala-steward
- Update mdoc, sbt-mdoc to 2.2.12 (#2274) @scala-steward
- Update scalatest to 3.2.3 (#2276) @scala-steward
- Update sbt-scalajs to 1.3.1 (#2270) @scala-steward
- Update sbt-ci-release to 1.5.4 (#2268) @scala-steward
- Update scala-parallel-collections to 1.0.0 (#2271) @scala-steward
- Bump docker/build-push-action from v1 to v2.1.0 (#2265) @dependabot
- Bump actions/upload-release-asset from v1.0.1 to v1.0.2 (#2266) @dependabot
- Bump actions/download-artifact from v1 to v2.0.6 (#2264) @dependabot
- Update actions versions to fix CI (#2263) @tgodzik
- Docstrings fix: first token may not start at 0 (#2259) @kitbellew
- upgrade to Scalameta 4.3.24 (#2260) @SethTisue
- Docstrings: add the Preserve style explicitly (#2254) @kitbellew
- FormatTokens fix: don't create
(BOF, BOF)
pair (#2256) @kitbellew - Docstrings fix: empty docstrings when
wrap=yes
(#2255) @kitbellew - Update .gitignore (#2248) @arbitrary-dev
- Update sbt-scalajs to 1.3.0 (#2234) @scala-steward
- Update sbt-native-packager to 1.7.6 (#2233) @scala-steward
- Update scalafmt-core to 2.7.5 (#2236) @scala-steward
- Update mdoc, sbt-mdoc to 2.2.10 (#2235) @scala-steward
- Update sbt-mima-plugin to 0.8.1 (#2232) @scala-steward
- Update typesafe:config to 1.4.1 (#2231) @scala-steward
- Update scalatags to 0.9.2 (#2230) @scala-steward
- Revert "Bump deps coursier,sbt" (#2237) @poslegm
- Bump deps coursier,sbt (#2225) @kpbochenek
v2.7.5
Features
- FormatWriter: force blank first line in docstrings (#2221) @kitbellew
Bug fixes
- Router: preserve breaks for source.keep in
case
(#2223) @kitbellew - Router: truncate indent for enclosed select chains (#2222) @kitbellew
v2.7.4
Bug fixes
- FormatWriter: correct first line of docstrings for
wrap=no
(#2217) @kitbellew
v2.7.3
Bug fixes
- Scalafmt: require space after
@
ammonite reload (#2205) @kitbellew
Dependency upgrades
- Update sbt-mima-plugin to 0.8.0 (#2206) @scala-steward
- Update scalameta, testkit to 4.3.22 (#2210) @scala-steward
- Update sbt-jmh to 0.4.0 (#2211) @scala-steward
- Update sbt-mdoc to 2.2.9 (#2208) @scala-steward
- Update sbt-scalajs to 1.2.0 (#2207) @scala-steward
Miscellaneous
v2.7.2
Bug fixes and improvements with rewrite rules
- RedundantParens: use AvoidInfix matcher correctly (#2203) @kitbellew
- Rewrite: interpolate, new, new anon as simple expr (#2201) @kitbellew
- RedundantBraces: don't rewrite expression of match (#2198) @kitbellew
- RedundantBraces: allow almost arbitrary prefix expressions (#2199) @kitbellew
v2.7.1
Updates
- Lambdas
- Router: beforeCurlyLambdaParams for paren lambdas (#2193) @kitbellew
- Newlines: break before params of multiline lambda (#2191) @kitbellew
- Enumerators
- FormatOps: use common rules for a generator body (#2189) @kitbellew
Bug fixes
- RedundantParens: check if postfix only is allowed (#2195) @kitbellew
- ModExt: use split width with StateColumn indents (#2192) @kitbellew
v2.7.0
Editions
- Edition: remove this feature completely (#2109) @kitbellew
CLI
In order to allow specifying a large number of files to the command-line tool, we now allow providing them via @file
argument; this file
will contain the names of all files and directories which would otherwise have been specified directly on the command line. A special case of @-
is to refer to stdin
.
- Add support to expand command-line arguments with @ symbol (#2146) @olafurpg
- Cli: add an option to read file names from stdin (#2162) @kitbellew
Ammonite
- Scalafmt: support
@
-reloaded Ammonite scripts (#2182) @kitbellew - TokenTraverser: exclude shebang line in ammonite (#2159) @kitbellew
Consistent formatting of body of definitions and control expressions
Previously, there was a single parameter (newlines.alwaysBeforeMultilineDef
) which allowed to force a line break after =
if the body of a method occupied multiple lines.
In this release, this parameter is deprecated and replaced with another multivalued parameter; NB: to enable this transition, the default behaviour was changed from forcing a break to allowing a space.
Additionally, when a break is not forced, formatting of body in method definition, variable assignment, control expressions (if
, for
, while
), case clauses has been standardized and controlled via the same parameters (with methods, for backwards compatibility, being optionally configured via a separate parameter).
- Parameters:
- Pull requests:
- Router: amend folded body to cover infix chains (#2185) @kitbellew
- Router: standard rule for body of def/if-else/case (#2158) @kitbellew
- Router: fix when comments follow
=
in def/val (#2123) @kitbellew
Indentation of infix chains
Previously, indentation with infix chains was applied inconsistently, occasionally failing altogether. In this release, indentation has been made more consistent and applied universally, with parameters documented.
- Parameters:
- Documented
indentOperator
- Added
indentOperator.topLevelOnly
- Documented
- Pull requests:
- FormatOps: fix infix indentation (#2180) @kitbellew
- IndentOperator: move topLevelOnly and document (#2173) @kitbellew
Formatting of lambdas and partial functions
- Changes:
- Formatting of single-case partial functions like lambdas, breaking after the parameters
- Parameters:
- Pull requests:
- Router: prefer not breaking before lambda params (#2125) @kitbellew
- Newlines: rename afterCurlyLambda{,Params} (#2110) @kitbellew
- Router: allow space after "{" in partial functions (#2108) @kitbellew
Formatting of paren-enclosed case body as with braces
- FormatOps: improve isCaseBodyEnclosedAsBlock (#2181) @kitbellew
- Router: format ()-enclosed case clause as a block (#2165) @kitbellew
Rewrite rules
- Dedicated setting for redundant braces in if-else (#2115) @poslegm
- Bug fixes:
- RedundantParens: look for NL before nested infix ops (#2164) @kitbellew
- RedundantBraces: fix method block as apply arg (#2161) @kitbellew
- Rewrite: replace delimiters with space (#2121) @kitbellew
- Fix a problem where parens are removed after a yield (#2118) @daddykotex
Miscellaneous
- [documentation] fix brace in example (#2178) @bluesheeptoken
- Release moved from Travis to GitHub Actions (#2139) @poslegm
- Install script compatibility with auto-uploaded artifacts (#2116) @poslegm
- Job for automatic native images uploading (#1711) (#2114) @poslegm
- Update links to Spotless integrations. (#2112) @nedtwigg
- Bug fixes:
- Router: attached comment as optimal in def body (#2184) @kitbellew
- Newlines: rename {never,avoid}InResultType (#2183) @kitbellew
- FormatWriter: fix align container logic for multiline alignment (#2160) @kitbellew
- FormatToken: ensure break before/after docstring (#2128) @kitbellew
- Router: delay break if detached comment follows
{
(#2126) @kitbellew - Router: prefer case break after
=>
overif
(#2119) @kitbellew
Dependency updates
- self formatting 2.6.4 (#2134) @poslegm
- Update sbt-scalafmt to 2.4.2 (#2170) @scala-steward
- Update sbt-mdoc to 2.2.5 (#2169) @scala-steward
- Update sbt-native-packager to 1.7.5 (#2167) @scala-steward
- Update sbt-buildinfo to 0.10.0 (#2166) @scala-steward
- Update scalatest to 3.2.2 (#2172) @scala-steward
- Update scalameta, testkit to 4.3.21 (#2171) @scala-steward
- Update sbt-scalajs to 1.1.1 (#2131) @scala-steward