Closed clee704 closed 3 years ago
$ scalafmt -c dev/.scalafmt.conf src
What if we add this command to pre-commit hook? Every committers should set their environment to use pre-commit hook so it cannot be mandatory though.
I think we can add a guideline in README or somewhere regarding scalafmt, and a git hook is a good one. There can be other ways, though, like running scalafmt automatically in your IDE or vim (using coc-metals).
It would be nice if we can configure scalastyle or use some other ways to check the formatting automatically during the build and CI.
Seems we can use sbt-scalafmt
to check the formatting. What do you think about adding the check to the build or CI to enforce the formatting? @imback82 @sezruby
I think we can add a guideline in README or somewhere regarding scalafmt
I mentioned to use 'reformat on save' in the formatting guild committed in #471 but it wasn't obligation so I wonder how many committers read it carefully and set it :(
sbt-scalafmt could be good. It is the project mentioned in the scalafmt guide. https://scalameta.org/scalafmt/docs/installation.html
Opened #476 for enforcing/checking scalafmt during build/CI
What is the context for this pull request?
What changes were proposed in this pull request?
Reformat files with
scalafmt
, as in the following command:Does this PR introduce any user-facing change?
No.
How was this patch tested?
Unit test