Skip to content

Commit

Permalink
Merge pull request #273 from mdedetrich/add-contributing-md-and-code-…
Browse files Browse the repository at this point in the history
…style-tasks

Add CONTRIBUTING.md along with code style tasks
  • Loading branch information
raboof authored Jul 31, 2023
2 parents 2514af0 + 8c8750c commit e913f21
Show file tree
Hide file tree
Showing 2 changed files with 21 additions and 0 deletions.
18 changes: 18 additions & 0 deletions CONTRIBUTING.md
Original file line number Diff line number Diff line change
@@ -0,0 +1,18 @@
# Contributing to Sbt Reproducible Builds

## Applying code style to the project

The project uses both [scalafix](https://scalacenter.github.io/scalafix/) and
[scalafmt](https://scalameta.org/scalafmt/) to ensure code quality which is automatically checked on every
PR. If you would like to check for any potential code style problems locally you can run `sbt checkCodeStyle` and if
you want to apply the code style then you can run `sbt applyCodeStyle`.

## Ignoring formatting commits in git blame

Throughout the history of the codebase various formatting commits have been applied as the scalafmt style has evolved over time, if desired
one can setup git blame to ignore these commits. The hashes for these specific are stored in [this file](.git-blame-ignore-revs) so to configure
git blame to ignore these commits you can execute the following.

```shell
git config blame.ignoreRevsFile .git-blame-ignore-revs
```
3 changes: 3 additions & 0 deletions build.sbt
Original file line number Diff line number Diff line change
Expand Up @@ -54,3 +54,6 @@ inThisBuild(
)
)
)

addCommandAlias("applyCodeStyle", ";+clean ;scalafixAll ;scalafmtAll; scalafmtSbt")
addCommandAlias("checkCodeStyle", ";+clean ;scalafixAll --check ;scalafmtCheckAll; scalafmtSbtCheck")

0 comments on commit e913f21

Please sign in to comment.