-
Notifications
You must be signed in to change notification settings - Fork 2
Expand file tree
/
Copy path.pre-commit-config.yaml
More file actions
100 lines (100 loc) · 3.02 KB
/
.pre-commit-config.yaml
File metadata and controls
100 lines (100 loc) · 3.02 KB
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
default_install_hook_types: ["pre-commit", "pre-push"]
default_stages: ["pre-commit"]
repos:
- repo: https://github.com/pre-commit/pre-commit-hooks
rev: v4.4.0
hooks:
- id: check-toml
- id: check-json
- id: check-merge-conflict
- id: check-yaml
args: ["--allow-multiple-documents"]
- id: trailing-whitespace
stages: [ "pre-commit" ]
- repo: local
hooks:
- id: google-style-java
name: google-style-java
language: script
entry: "tools/format-java.sh"
files: '\.java$'
- repo: local
hooks:
- id: java-no-wildcard-imports
name: "Java no wildcard imports"
language: script
entry: tools/java-no-wildcard-imports.sh
files: '\.java$'
- repo: local
hooks:
- id: bazel-buildifier
name: "bazel buildifier"
entry: buildifier
files: '\.bazel$|\.bzl$|WORKSPACE'
args: ["-lint=fix"]
language: "system"
description: "Runs buildifier."
- repo: local
hooks:
- id: precommit-bazel-tests
name: "precommit bazel tests"
language: python
entry: "tools/precommit-bazel-tests.py"
description: Run bazel builds and tests when creating commits.
stages: [manual]
- repo: local
hooks:
- id: enforce-no-main-commit
name: enforce-no-main-commit
language: script
entry: "tools/enforce-no-main-commit.sh"
types: [file]
pass_filenames: false
- repo: local
hooks:
- id: base-branch-diff
name: base-branch-diff
language: script
entry: "tools/base-branch-diff.sh"
types: [file]
pass_filenames: false
stages: ["manual"] # used to be pre-push
verbose: true
- repo: local
hooks:
- id: 1_1_1_principle
name: "Ensures that the 1:1:1 rule is maintained"
entry: ./tools/java_refactor_scripts/ensure_1_1_1_java.py
language: python
stages: [ "pre-commit" ]
always_run: true
description: "Runs a check on all BUILD.bazel files modified to enforce the 1:1:1 rule in Java files"
- repo: local
hooks:
- id: gazelle-java
name: "Generate java rules"
entry: "tools/generate_java_rules.py"
language: python
stages: [ "pre-commit" ]
files: '^java/'
pass_filenames: false
description: "Runs gazelle java to generate BUILD files"
- repo: local
hooks:
- id: pmd
name: Java PMD
language: script
entry: "tools/lint/lint.sh"
files: '\.java$'
types: [file]
args: ["--fail-on-violation"]
- repo: local
hooks:
- id: sync-main-and-test
name: "Ensure src/main/java/ and src/test/java/ folders are in sync"
entry: "tools/java_refactor_scripts/sync_java_tests.py"
language: python
stages: [ "pre-commit" ]
files: '^java/'
always_run: true
description: "Runs a check to ensure we move/rename test targets on changes to src files"