Skip to content

Commit

Permalink
Merge pull request #505 from lenguyenthanh/sbt-format-alias
Browse files Browse the repository at this point in the history
Add fmt & fmtCheck alias for formatting all projects
  • Loading branch information
ornicar authored Dec 24, 2023
2 parents 001d0a2 + c33c740 commit 7930d72
Show file tree
Hide file tree
Showing 3 changed files with 7 additions and 12 deletions.
5 changes: 1 addition & 4 deletions .github/workflows/ci.yml
Original file line number Diff line number Diff line change
Expand Up @@ -28,7 +28,4 @@ jobs:
run: sbt testKit/test

- name: Check Formatting
run: |
sbt scalachess/scalafmtCheckAll
sbt bench/scalafmtCheckAll
sbt testKit/scalafmtCheckAll
run: sbt fmtCheck
10 changes: 2 additions & 8 deletions README.md
Original file line number Diff line number Diff line change
Expand Up @@ -39,12 +39,6 @@ To run benchmarks for a specific class:

bench / Jmh / run -rf json .*PlayBench.*

Code formatting
---------------
To run [scalafmt](https://scalameta.org/scalafmt/docs/installation.html):

This repository uses [scalafmt](https://scalameta.org/scalafmt/).

Please [install it for your code editor](https://scalameta.org/scalafmt/docs/installation.html)
if you're going to contribute to this project.

If you don't install it, please run `scalafmtAll` in the sbt console before committing.
sbt fmt
4 changes: 4 additions & 0 deletions build.sbt
Original file line number Diff line number Diff line change
Expand Up @@ -60,3 +60,7 @@ lazy val testKit = project
testFrameworks += new TestFramework("weaver.framework.CatsEffect")
)
.dependsOn(scalachess % "compile->compile")

addCommandAlias("fmtCheck", "all scalachess/scalafmtCheckAll bench/scalafmtCheckAll testKit/scalafmtCheckAll")
addCommandAlias("fmt", "all scalachess/scalafmtAll bench/scalafmtAll testKit/scalafmtAll")

0 comments on commit 7930d72

Please sign in to comment.