-
Notifications
You must be signed in to change notification settings - Fork 17
/
Copy path.pre-commit-config.yaml
104 lines (95 loc) · 2.8 KB
/
.pre-commit-config.yaml
1
2
3
4
5
6
7
8
9
10
11
12
13
14
15
16
17
18
19
20
21
22
23
24
25
26
27
28
29
30
31
32
33
34
35
36
37
38
39
40
41
42
43
44
45
46
47
48
49
50
51
52
53
54
55
56
57
58
59
60
61
62
63
64
65
66
67
68
69
70
71
72
73
74
75
76
77
78
79
80
81
82
83
84
85
86
87
88
89
90
91
92
93
94
95
96
97
98
99
100
101
102
103
104
repos:
- repo: https://github.com/pre-commit/pre-commit-hooks
rev: v4.4.0
hooks:
- id: trailing-whitespace
exclude: (?x)(
^config_system/tests/formatter/|
gendiffer/tests.*build.ninja|
gendiffer/tests.*Android.bp|
gazelle/tests/.*/expectedStderr.txt|
patches/
)
- id: end-of-file-fixer
exclude: |
(?x)(
^config_system/tests/formatter/|
expectedExitCode.txt|
gendiffer/tests.*build.ninja|
gendiffer/tests.*Android.bp|
patches/
)
- id: check-yaml
- id: check-added-large-files
- repo: https://github.com/pre-commit/mirrors-prettier
rev: v3.0.0
hooks:
- id: prettier
- repo: https://github.com/psf/black
rev: 23.7.0
hooks:
- id: black
name: black
entry: black
language: python
minimum_pre_commit_version: 2.9.2
require_serial: true
types: [file, python]
- repo: https://github.com/pre-commit/pre-commit-hooks
rev: v2.3.0
hooks:
- id: flake8
args: # arguments to configure flake8
- "--max-line-length=88"
- "--max-complexity=18"
- "--select=B,C,E,F,W,T4,B9"
# https://flake8.pycqa.org/en/latest/user/error-codes.html
- "--ignore=E203,E266,E501,W503,F403,F401,E402"
- repo: https://github.com/shellcheck-py/shellcheck-py
rev: v0.9.0.5
hooks:
- id: shellcheck
name: shellcheck
description: Lint shell scripts with shellcheck
entry: shellcheck --severity=warning --exclude=1090 # Disable warning for certain quoting
language: python
types: [shell]
require_serial: true
- repo: https://github.com/fsfe/reuse-tool
rev: v2.1.0
hooks:
- id: reuse
name: reuse
entry: reuse
args: ["lint"]
language: python
pass_filenames: false
description: "Lint the project directory for compliance with the REUSE Specification"
language_version: python3
types_or:
- text
- binary
- repo: local
hooks:
- id: go-fmt
name: Go Format
language: golang
types: [file, go]
entry: gofmt
args: ["-w", "-s"]
- id: buildifier
name: Buildifier
description: Formatting Bazel files
language: golang
additional_dependencies:
- github.com/bazelbuild/buildtools/[email protected]
files: (BUILD|WORKSPACE|.+\.bazel|.+\.bzl)$
entry: buildifier
args: ["--lint=fix"]
- id: bpfmt
name: "blueprint formatter"
entry: bazelisk run //:bpfmt_wrapper -- -w
language: system
files: ^.*build.bp$
types_or: [text]
require_serial: true