/scalafmt

Opinionated code formatter for Scala

Primary LanguageScalaApache License 2.0Apache-2.0

scalafmt codecov.io Build Status Join the chat at https://gitter.im/olafurpg/scalafmt

User documentation

Head over to the user docs for instructions on how to install scalafmt.

Developer documentation - contributing

  • core/testOnly org.scalafmt.FormatTests: runs the fast, most relevant, unit tests.
    • After each run, a performance report is generated in target/index.html. I usually keep a browser tab open at localhost:3000/target/index.html along with this background process: browser-sync start --server --files "target/*.html". See Browsersync.
  • core/testOnly org.scalafmt.FidelityTest: runs the formatter on all files in this project.
  • run-benchmarks.sh script to run jmh benchmarks.
  • core/test:runMain org.scalafmt.FormatExperimentApp:
    1. Uses wget to download a ~20mb tar (repos.tar.gz) that contains ~28.000 Scala source files from public Github repos,
    2. untars with tar,
    3. runs scalafmt on a subset of the files, specified in FormatExperiment. Runs various property based checks under timing constraints (around 10s per file),
    4. prints summary report to console.
  • instructions for the tests are here.