chore(deps): update dependency scalafmt to v2.7.5 #56
Add this suggestion to a batch that can be applied as a single commit.
This suggestion is invalid because no changes were made to the code.
Suggestions cannot be applied while the pull request is closed.
Suggestions cannot be applied while viewing a subset of changes.
Only one suggestion per line can be applied in a batch.
Add this suggestion to a batch that can be applied as a single commit.
Applying suggestions on deleted lines is not supported.
You must change the existing code in this line in order to create a valid suggestion.
Outdated suggestions cannot be applied.
This suggestion has been applied or marked resolved.
Suggestions cannot be applied from pending reviews.
Suggestions cannot be applied on multi-line comments.
Suggestions cannot be applied while the pull request is queued to merge.
Suggestion cannot be applied right now. Please check back later.
This PR contains the following updates:
2.3.2
->2.7.5
Release Notes
scalameta/scalafmt (scalafmt)
v2.7.5
Compare Source
Features
Bug fixes
case
(#2223) @kitbellewv2.7.4
Compare Source
Bug fixes
wrap=no
(#2217) @kitbellewv2.7.3
Compare Source
Bug fixes
@
ammonite reload (#2205) @kitbellewDependency upgrades
Miscellaneous
v2.7.2
Compare Source
Bug fixes and improvements with rewrite rules
v2.7.1
Compare Source
Updates
Bug fixes
v2.7.0
Compare Source
Editions
CLI
In order to allow specifying a large number of files to the command-line tool, we now allow providing them via
@file
argument; thisfile
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 tostdin
.Ammonite
@
-reloaded Ammonite scripts (#2182) @kitbellewConsistent 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).newlines.beforeMultiline
newlines.beforeMultilineDef
=
in def/val (#2123) @kitbellewIndentation 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.
indentOperator
indentOperator.topLevelOnly
Formatting of lambdas and partial functions
newlines.beforeCurlyLambdaParams
newlines.afterCurlyLambdaParams
Formatting of paren-enclosed case body as with braces
Rewrite rules
rewrite.redundantBraces.ifElseExpressions
Miscellaneous
{
(#2126) @kitbellew=>
overif
(#2119) @kitbellewDependency updates
v2.6.4
Compare Source
Bug fixes
Pull Requests
v2.6.3
Compare Source
Pull Requests
v2.6.2
Compare Source
This release adds several fixes to handling of docstrings and comments, and some documentation.
One of the fixes addresses the long-standing #1334 (indentation of select chain interrupted by a comment) when
newlines.source = classic
. There's a new parameter (see https://scalameta.org/scalafmt/docs/configuration.html#optinencloseclassicchains).Pull Requests
Documentation
.scalafix.conf
& the CLI binary versions relate (#2040) @bjaglinBuild
Dependencies
v2.6.1
Compare Source
Bug fixes
v2.6.0
Compare Source
Major changes
This release is generally dedicated to non-Scala features.
Scaladoc and comments
We are introducing scaladoc and comment formatting changes in this version. Please see
https://scalameta.org/scalafmt/docs/configuration.html#docstrings and
https://scalameta.org/scalafmt/docs/configuration.html#comment-processing
Some related pull requests:
*
(#1982) @kitbellewScala embedded in XML
To modify formatting of scala code within XML, see https://scalameta.org/scalafmt/docs/configuration.html#xmlliteralsassumeformatted
Line overflow
If it's desirable to avoid breaking some very long lines if they will exceed the
maxColumn
limit even with a newline, see https://scalameta.org/scalafmt/docs/configuration.html#newlinesavoidforsimpleoverflowCLI
When running the
scalafmt
command-line tool, if one specified any Scala files explicitly, they would be formatted regardless of project filters specified in.scalafmt.conf
.Here, we introduce a new CLI option
--respect-project-filters
to modify this behaviour.Other features
extends
if ctor is folded (#1980) @kitbellewIdempotence fixes
Bug fixes
s"""|
(#2001) @kitbellew=>
in lambda without args (#1983) @kitbellewDependency updates
v2.5.3
Compare Source
Pull Requests
=>
in source=keep (#1963) @kitbellewv2.5.2
Compare Source
Pull Requests
Defn
withBlock
as body (#1947) @kitbellewv2.5.1
Compare Source
Bug fixes
Scala211
,Scala212
,Scala213
etc.)if (...)(x, y) => ...
Pull Requests
(
in function (#1944) @kitbellewv2.5.0
Compare Source
Major changes
Managed formatting modes
We are defining the
newlines.source
parameter (see https://scalameta.org/scalafmt/docs/configuration.html#newlinessource), which introduces managed, wholesale changes to how code is formatted. One of the options (keep
) is intended to hand control over line breaks to the user, while the other two (fold
andunfold
) will in fact completely ignore user input.These modes are new and will potentially have a few bugs here and there (especially
keep
), in addition to, possibly, causing mixed sentiment of the "this looks almost good, if only we could do this differently" type. That is expected and likely par for the course for an opinionated formatter thatscalafmt
was intended to be.However, please submit your bugs and opinions via https://github.com/scalameta/scalafmt/issues/new or comment on existing ones, so that if there are ideas on how to modify the behaviour in a way that resonates with the community, without violating the constraints (for
fold
/unfold
, user input must be ignored), we'll implement them.Editions
Editions were envisioned as a way to allow formatter upgrades while preserving formatting behaviour, but this turned out to be substantially harder to do, so edition 2020-01 is the last one. Also, the same result can easily be accomplished by not upgrading the formatter.
File overrides
One can customize configuration to apply to a subset of files, based on a file pattern. Cases can include special formatting rules for
sbt
files, or others for test suites (for instance, usingAvoidInfix
rewrite for main code with an emptyrewrite.neverInfix.excludeFilters
while allowing specialscalatest
DSL for tests withrewrite.neverInfix.excludeFilters
containingshould
etc.).See https://scalameta.org/scalafmt/docs/configuration.html#fileoverride
Infix formatting
Formatting line breaks around infix expressions turned out to be a difficult problem, and a couple of years ago
scalafmt
gave up on that and let the user choose where to break. Here, we are definining a couple of parameters to try and take that control back, by adding newlines after an infix operator (as the only universally safe place; there are some cases when a break can happen before an infix operator, but those are rare, and this logic doesn't attempt to discern them).See https://scalameta.org/scalafmt/docs/configuration.html#newlinesafterinfix
Presets
This is not a new setting but a new, more general way to specify groups of parameters. Previously, you'd use
style = defaultWithAlign
oralign = most
ordanglingParentheses = true
. However, because configuration is represented using HOCON/json, doing it like that meant one couldn't partially override these presets.The new approach is to define
preset = defaultWithAlign
, oralign.preset = most
, ordanglingParentheses.preset = true
. This way, naming is standardized, and partial overrides are possible.Please see https://scalameta.org/scalafmt/docs/configuration.html#presets.
Alignment
The major additions, apart from several bug fixes, are
Formatting around
implicit
and danglingThis was handled in fixed way in classic formatting mode while had some control in
verticalMultiline
mode. We brought those styles together, by adding a few parameters to control the outcome.Please see:
exclude
andctrlSite
are new)Indentation
We added several new options to control indentation:
continuationIndent.ctorSite
with
expressions following anextends
:continuationIndent.withSiteRelativeToExtends
Please see https://scalameta.org/scalafmt/docs/configuration.html#indentation
Top-level statements
In addition to enforcing breaks before top-level statements, we now allow the same after the top-level statements. Also, there's a more granular control of which top-level statements are considered. Please see https://scalameta.org/scalafmt/docs/configuration.html#newlinestoplevelstatements
Rewrites
multiple
parameter (see https://scalameta.org/scalafmt/docs/configuration.html#trailing-commas)AvoidInfix
RedundantParens
expanded to more casesLiterals
A number of new parameters is available to control formatting of numeric literals. Please see https://scalameta.org/scalafmt/docs/configuration.html#literals.
Defaults
The following are changes in default behaviour:
newlines.afterCurlyLambda = never
: the parameter itself doesn't change, but its behaviour changed since 2.4.2 (a newsquash
setting mimics the oldnever
); see https://scalameta.org/scalafmt/docs/configuration.html#newlinesaftercurlylambdarewrite.redundantBraces.generalExpressions = true
; previously, it wasfalse
align.multiline = true
: this new setting modifies the behaviour ofalign.preset = most
danglingParentheses.ctrlSite = true
: this is a new setting; set tofalse
to get previous behaviour; see https://scalameta.org/scalafmt/docs/configuration.html#danglingparenthesesctrlsitenewlines.alwaysBeforeMultilineDef
: there is a change in behaviour due to a bugfix, making this option apply consistently.Pull Requests since v2.5.0-RC3
v2.4.2
: Scalafmt v2.4.2Compare Source
Features
Bug fixes
Fixes: #448 #1462 #1482 #1485 #1599 #1659 #1714 #1717 #1718 #1720
Pull Requests
v2.4.1
: Scalafmt v2.4.1Compare Source
Pull requests
FormatWriter: {} => (): don't rewrite some lambdas (#1709) @kitbellew
Fixes
#1707 #1708
v2.4.0
: Scalafmt v2.4.0Compare Source
Pull Requests
preserve
without a break (#1705) @kitbellewDependency updates
Configuration
📅 Schedule: Branch creation - "every weekend" (UTC), Automerge - At any time (no schedule defined).
🚦 Automerge: Disabled by config. Please merge this manually once you are satisfied.
♻ Rebasing: Whenever PR becomes conflicted, or you tick the rebase/retry checkbox.
🔕 Ignore: Close this PR and you won't be reminded about this update again.
This PR was generated by Mend Renovate. View the repository job log.