chore: setup a buildifier pre-commit hook (#661)
Matches the one just landed in rules_apple: 61bc7c01ae
This commit is contained in:
parent
eb72705d3d
commit
118c55d424
|
@ -187,4 +187,5 @@ tasks:
|
|||
|
||||
buildifier:
|
||||
version: latest
|
||||
# keep this argument in sync with .pre-commit-config.yaml
|
||||
warnings: "all"
|
||||
|
|
|
@ -0,0 +1,13 @@
|
|||
# See CONTRIBUTING.md for instructions.
|
||||
# See https://pre-commit.com for more information
|
||||
# See https://pre-commit.com/hooks.html for more hooks
|
||||
repos:
|
||||
- repo: https://github.com/keith/pre-commit-buildifier
|
||||
rev: 4.0.1.1
|
||||
hooks:
|
||||
- id: buildifier
|
||||
args: &args
|
||||
# Keep this argument in sync with .bazelci/config.yaml
|
||||
- --warnings=all
|
||||
- id: buildifier-lint
|
||||
args: *args
|
|
@ -3,6 +3,19 @@
|
|||
We'd love to accept your patches and contributions to this project. There are
|
||||
just a few small guidelines you need to follow.
|
||||
|
||||
## 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 the Buildkite CI will yell at you about formatting/linting violations.
|
||||
|
||||
## Contributor License Agreement
|
||||
|
||||
Contributions to this project must be accompanied by a Contributor License
|
||||
|
|
|
@ -1,81 +1,81 @@
|
|||
package(default_visibility = ['//visibility:public'])
|
||||
package(default_visibility = ["//visibility:public"])
|
||||
|
||||
filegroup(
|
||||
name = 'gcc',
|
||||
srcs = [
|
||||
'bin/arm-linux-gnueabihf-gcc',
|
||||
],
|
||||
name = "gcc",
|
||||
srcs = [
|
||||
"bin/arm-linux-gnueabihf-gcc",
|
||||
],
|
||||
)
|
||||
|
||||
filegroup(
|
||||
name = 'ar',
|
||||
srcs = [
|
||||
'bin/arm-linux-gnueabihf-ar',
|
||||
],
|
||||
name = "ar",
|
||||
srcs = [
|
||||
"bin/arm-linux-gnueabihf-ar",
|
||||
],
|
||||
)
|
||||
|
||||
filegroup(
|
||||
name = 'ld',
|
||||
srcs = [
|
||||
'bin/arm-linux-gnueabihf-ld',
|
||||
],
|
||||
name = "ld",
|
||||
srcs = [
|
||||
"bin/arm-linux-gnueabihf-ld",
|
||||
],
|
||||
)
|
||||
|
||||
filegroup(
|
||||
name = 'nm',
|
||||
srcs = [
|
||||
'bin/arm-linux-gnueabihf-nm',
|
||||
],
|
||||
name = "nm",
|
||||
srcs = [
|
||||
"bin/arm-linux-gnueabihf-nm",
|
||||
],
|
||||
)
|
||||
|
||||
filegroup(
|
||||
name = 'objcopy',
|
||||
srcs = [
|
||||
'bin/arm-linux-gnueabihf-objcopy',
|
||||
],
|
||||
name = "objcopy",
|
||||
srcs = [
|
||||
"bin/arm-linux-gnueabihf-objcopy",
|
||||
],
|
||||
)
|
||||
|
||||
filegroup(
|
||||
name = 'objdump',
|
||||
srcs = [
|
||||
'bin/arm-linux-gnueabihf-objdump',
|
||||
],
|
||||
name = "objdump",
|
||||
srcs = [
|
||||
"bin/arm-linux-gnueabihf-objdump",
|
||||
],
|
||||
)
|
||||
|
||||
filegroup(
|
||||
name = 'strip',
|
||||
srcs = [
|
||||
'bin/arm-linux-gnueabihf-strip',
|
||||
],
|
||||
name = "strip",
|
||||
srcs = [
|
||||
"bin/arm-linux-gnueabihf-strip",
|
||||
],
|
||||
)
|
||||
|
||||
filegroup(
|
||||
name = 'as',
|
||||
srcs = [
|
||||
'bin/arm-linux-gnueabihf-as',
|
||||
],
|
||||
name = "as",
|
||||
srcs = [
|
||||
"bin/arm-linux-gnueabihf-as",
|
||||
],
|
||||
)
|
||||
|
||||
filegroup(
|
||||
name = 'compiler_pieces',
|
||||
srcs = glob([
|
||||
'arm-linux-gnueabihf/**',
|
||||
'libexec/**',
|
||||
'lib/gcc/arm-linux-gnueabihf/**',
|
||||
'include/**',
|
||||
]),
|
||||
name = "compiler_pieces",
|
||||
srcs = glob([
|
||||
"arm-linux-gnueabihf/**",
|
||||
"libexec/**",
|
||||
"lib/gcc/arm-linux-gnueabihf/**",
|
||||
"include/**",
|
||||
]),
|
||||
)
|
||||
|
||||
filegroup(
|
||||
name = 'compiler_components',
|
||||
srcs = [
|
||||
':gcc',
|
||||
':ar',
|
||||
':ld',
|
||||
':nm',
|
||||
':objcopy',
|
||||
':objdump',
|
||||
':strip',
|
||||
':as',
|
||||
],
|
||||
name = "compiler_components",
|
||||
srcs = [
|
||||
":ar",
|
||||
":as",
|
||||
":gcc",
|
||||
":ld",
|
||||
":nm",
|
||||
":objcopy",
|
||||
":objdump",
|
||||
":strip",
|
||||
],
|
||||
)
|
||||
|
|
Loading…
Reference in New Issue