Skip to content

How to preserve format when no rule is offended #3727

Answered by kitbellew
ftucky asked this question in Q&A
Discussion options

You must be logged in to vote

@ftucky there's an implied additional "rule" (or property of scalafmt design), that for everything else there's a predefined fallback (no space is some cases, one space in others).

scalafmt is not a linter which checks compliance with some rules, it's a tool which will produce its own formatting of code subject to a few configurable partial constraints.

if scalafmt is asked to verify formatting, it checks whether the code was previously formatted by scalafmt using the same configuration, and not whether it complies with a subset of intentions expressed via a few explicit parameters in that configuration.

it's impossible to do that you described.

Replies: 1 comment 1 reply

Comment options

You must be logged in to vote
1 reply
@ftucky
Comment options

Answer selected by ftucky
Sign up for free to join this conversation on GitHub. Already have an account? Sign in to comment
Category
Q&A
Labels
None yet
2 participants