-
-
Notifications
You must be signed in to change notification settings - Fork 44
Commit
This commit does not belong to any branch on this repository, and may belong to a fork outside of the repository.
chore: copy pre-commit setup from rules-template (#107)
- Loading branch information
Showing
2 changed files
with
45 additions
and
0 deletions.
There are no files selected for viewing
This file contains bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
Original file line number | Diff line number | Diff line change |
---|---|---|
@@ -0,0 +1,31 @@ | ||
# See CONTRIBUTING.md for instructions. | ||
# See https://pre-commit.com for more information | ||
# See https://pre-commit.com/hooks.html for more hooks | ||
|
||
# Commitizen runs in commit-msg stage | ||
# but we don't want to run the other hooks on commit messages | ||
default_stages: [commit] | ||
|
||
# Use a slightly older version of node by default | ||
# as the default uses a very new version of GLIBC | ||
default_language_version: | ||
node: 16.18.0 | ||
|
||
repos: | ||
# Check formatting and lint for starlark code | ||
- repo: https://github.com/keith/pre-commit-buildifier | ||
rev: 6.1.0.1 | ||
hooks: | ||
- id: buildifier | ||
- id: buildifier-lint | ||
# Enforce that commit messages allow for later changelog generation | ||
- repo: https://github.com/commitizen-tools/commitizen | ||
rev: v2.18.0 | ||
hooks: | ||
# Requires that commitizen is already installed | ||
- id: commitizen | ||
stages: [commit-msg] | ||
- repo: https://github.com/pre-commit/mirrors-prettier | ||
rev: "v2.4.0" | ||
hooks: | ||
- id: prettier |
This file contains bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
Original file line number | Diff line number | Diff line change |
---|---|---|
@@ -0,0 +1,14 @@ | ||
# How to Contribute | ||
|
||
## Formatting | ||
|
||
Starlark files should be formatted by buildifier. | ||
We suggest using a pre-commit hook to automate this. | ||
First [install pre-commit](https://pre-commit.com/#installation), | ||
then run | ||
|
||
```shell | ||
pre-commit install | ||
``` | ||
|
||
Otherwise later tooling on CI will yell at you about formatting/linting violations. |