Ecosyste.ms: Awesome
An open API service indexing awesome lists of open source software.
https://github.com/keith/pre-commit-buildifier
Fix & Lint starlark code with buildifier and pre-commit
https://github.com/keith/pre-commit-buildifier
bazel pre-commit
Last synced: 16 days ago
JSON representation
Fix & Lint starlark code with buildifier and pre-commit
- Host: GitHub
- URL: https://github.com/keith/pre-commit-buildifier
- Owner: keith
- License: mit
- Created: 2021-05-29T02:11:31.000Z (over 3 years ago)
- Default Branch: main
- Last Pushed: 2024-08-27T16:57:01.000Z (3 months ago)
- Last Synced: 2024-10-12T06:08:18.630Z (about 1 month ago)
- Topics: bazel, pre-commit
- Language: Shell
- Homepage:
- Size: 22.5 KB
- Stars: 15
- Watchers: 3
- Forks: 9
- Open Issues: 2
-
Metadata Files:
- Readme: README.md
- License: LICENSE
Awesome Lists containing this project
README
# pre-commit-buildifier
This is a hook for [pre-commit][pc] and [buildifier][buildifier] that
doesn't require it to be installed ahead of time and easily lets you pin
to a specific version.## Usage
```yaml
- repo: https://github.com/keith/pre-commit-buildifier
rev: TAG OR SHA
hooks:
- id: buildifier
- id: buildifier-lint
```This repo provides multiple hooks because some buildifier rules cannot
be autofixed. The `buildifier` hook fixes everything that can while the
`buildifier-lint` hook prints unfixable warnings. If you use both of
them you should use them in that order so you don't end up in duplicate
warnings.If you'd like to pass custom flags to buildifier (as well as the default
mode configurations) you can use pre-commit's `args`:```yaml
- id: buildifier
args: [custom, flags]
```[buildifier]: https://github.com/bazelbuild/buildtools/tree/master/buildifier
[pc]: https://pre-commit.com