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

Please document how to apply configuration settings on the web site #304

Open
ConradHughes opened this issue Mar 12, 2024 · 3 comments
Open

Comments

@ConradHughes
Copy link

The scalafmt sbt plugin web site describes some useful settings here — for example scalafmtFilter. However it doesn't say how to actually set these settings, and doing that seems to be somewhat non-obvious. For example, you might naively think .scalafmt.conf wouldn't be a bad place to try, but apparently it is (a bad place to try).

It would be helpful if the web site documentation provided an example of your recommended approach to configuring some, if not all, of the listed settings.

It took a while to find that I could add

scalafmtFilter := "diff-dirty"

… to build.sbt, but even this raised continuous complaints until modified to the arcane-looking

scalafmtFilter.withRank(KeyRanks.Invisible) := "diff-dirty"

… if this is indeed the canonical way to achieve this setting, then well and good, but it might save others time and confusion if something similar appeared in the settings documentation.

Thanks very much for your work.

@kitbellew
Copy link
Contributor

@ConradHughes please feel free to send in a pr with these changes. i am not sure we have any experts on using sbt as the nuance of .withRank(...) is lost on me.

@kitbellew kitbellew transferred this issue from scalameta/scalafmt Mar 13, 2024
@kitbellew
Copy link
Contributor

i have also transferred this issue to the sbt plugin repo. you may have noticed the issue template for the original repository was focused on formatting problems and directed any sbt requests to this repo instead.

@ConradHughes
Copy link
Author

Thanks for your response @kitbellew, and sorry for the slow action on this; I will try to get you a PR some time soon.

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

No branches or pull requests

2 participants