Skip to content
New issue

Have a question about this project? Sign up for a free GitHub account to open an issue and contact its maintainers and the community.

By clicking “Sign up for GitHub”, you agree to our terms of service and privacy statement. We’ll occasionally send you account related emails.

Already on GitHub? Sign in to your account

chore(deps): update dependency scalafmt to v2.7.5 #56

Open
wants to merge 1 commit into
base: master
Choose a base branch
from

Conversation

renovate[bot]
Copy link
Contributor

@renovate renovate bot commented Apr 14, 2024

This PR contains the following updates:

Package Update Change
scalafmt minor 2.3.2 -> 2.7.5

Release Notes

scalameta/scalafmt (scalafmt)

v2.7.5

Compare Source

Features

Bug fixes

v2.7.4

Compare Source

Bug fixes

v2.7.3

Compare Source

Bug fixes

Dependency 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; 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.

Ammonite

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).

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.

Formatting of lambdas and partial functions

Formatting of paren-enclosed case body as with braces

Rewrite rules

Miscellaneous

Dependency updates

v2.6.4

Compare Source

Bug fixes

Pull Requests

v2.6.3

Compare Source

⚠️ ⛔ 💣 This version is broken, do not use!

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

Build

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:

Scala 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#newlinesavoidforsimpleoverflow

CLI

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

Idempotence fixes

Bug fixes

Dependency updates

v2.5.3

Compare Source

Pull Requests

v2.5.2

Compare Source

Pull Requests

v2.5.1

Compare Source

Bug fixes

  • support non-default dialects (Scala211, Scala212, Scala213 etc.)
  • add space before lambda in if (...)(x, y) => ...
  • don't align multiline expressions separated by a blank line
  • don't remove parentheses around an infix with a line break before the operator

Pull Requests

v2.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 and unfold) 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 that scalafmt 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, using AvoidInfix rewrite for main code with an empty rewrite.neverInfix.excludeFilters while allowing special scalatest DSL for tests with rewrite.neverInfix.excludeFilters containing should 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 or align = most or danglingParentheses = 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, or align.preset = most, or danglingParentheses.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 dangling

This 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:

Indentation

We added several new options to control 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
Literals

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:

Pull Requests since v2.5.0-RC3

v2.4.2: Scalafmt v2.4.2

Compare Source

Features

Bug fixes

Fixes: #​448 #​1462 #​1482 #​1485 #​1599 #​1659 #​1714 #​1717 #​1718 #​1720

Pull Requests

v2.4.1: Scalafmt v2.4.1

Compare Source

Pull requests

FormatWriter: {} => (): don't rewrite some lambdas (#​1709) @​kitbellew

Fixes

#​1707 #​1708

v2.4.0: Scalafmt v2.4.0

Compare Source

Pull Requests

Dependency 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.


  • If you want to rebase/retry this PR, check this box

This PR was generated by Mend Renovate. View the repository job log.

Sign up for free to join this conversation on GitHub. Already have an account? Sign in to comment
Labels
None yet
Projects
None yet
Development

Successfully merging this pull request may close these issues.

0 participants