Skip to content

Commit 9edc90c

Browse files
authored
Add buildifier pre-commit hook (bazelbuild#632)
Matches the one just landed in rules_apple: bazelbuild/rules_apple@61bc7c0
1 parent f237be4 commit 9edc90c

File tree

2 files changed

+22
-0
lines changed

2 files changed

+22
-0
lines changed

.pre-commit-config.yaml

Lines changed: 9 additions & 0 deletions
Original file line numberDiff line numberDiff line change
@@ -0,0 +1,9 @@
1+
# See CONTRIBUTING.md for instructions.
2+
# See https://pre-commit.com for more information
3+
# See https://pre-commit.com/hooks.html for more hooks
4+
repos:
5+
- repo: https://github.com/keith/pre-commit-buildifier
6+
rev: 4.0.1.1
7+
hooks:
8+
- id: buildifier
9+
- id: buildifier-lint

CONTRIBUTING.md

Lines changed: 13 additions & 0 deletions
Original file line numberDiff line numberDiff line change
@@ -3,6 +3,19 @@
33
We'd love to accept your patches and contributions to this project. There are
44
just a few small guidelines you need to follow.
55

6+
## Formatting
7+
8+
Starlark files should be formatted by buildifier.
9+
We suggest using a pre-commit hook to automate this.
10+
First [install pre-commit](https://pre-commit.com/#installation),
11+
then run
12+
13+
```shell
14+
pre-commit install
15+
```
16+
17+
Otherwise the Buildkite CI will yell at you about formatting/linting violations.
18+
619
## File or claim an issue
720

821
Please let us know what you're working on if you want to change or add to the

0 commit comments

Comments
 (0)