-
Notifications
You must be signed in to change notification settings - Fork 131
Expand file tree
/
Copy path.pre-commit-config.yaml
More file actions
98 lines (85 loc) · 2.42 KB
/
.pre-commit-config.yaml
File metadata and controls
98 lines (85 loc) · 2.42 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
# See https://pre-commit.com for more information
# See https://pre-commit.com/hooks.html for more hooks
repos:
# Built-in hooks
- repo: https://github.com/pre-commit/pre-commit-hooks
rev: "v5.0.0"
hooks:
- id: trailing-whitespace
- id: end-of-file-fixer
- id: check-yaml
- id: check-added-large-files
args: ['--maxkb=500000'] # 500MB
# Custom search and replace rules for HEIR
- repo: https://github.com/mattlqx/pre-commit-search-and-replace
rev: v1.0.5
hooks:
- id: search-and-replace
files: \.(cpp|h|td|mlir)$
# clang-format
- repo: https://github.com/pre-commit/mirrors-clang-format
rev: "v18.1.2"
hooks:
- id: clang-format
args: ["--style=Google"]
# Starlark
- repo: https://github.com/keith/pre-commit-buildifier
rev: "6.3.3"
hooks:
- id: buildifier
- id: buildifier-lint
# Check for spelling
# Config in pyproject.toml
- repo: https://github.com/codespell-project/codespell
rev: "v2.4.1"
hooks:
- id: codespell
# Changes tabs to spaces
- repo: https://github.com/Lucas-C/pre-commit-hooks
rev: "v1.5.4"
hooks:
- id: remove-tabs
exclude: "^(.*[.]go|go.mod|go.sum)"
# Github workflow actionlint
- repo: https://github.com/Mateusz-Grzelinski/actionlint-py
rev: "v1.7.11.24"
hooks:
- id: actionlint
additional_dependencies: [ pyflakes>=3.0.1, shellcheck-py>=0.9.0.5 ]
# Ensure github actions are pinned
- repo: https://github.com/lalten/check-gha-pinning
rev: "v1.3.1"
hooks:
- id: check-gha-pinning
# mdformat
- repo: https://github.com/executablebooks/mdformat
rev: 0.7.17
hooks:
- id: mdformat
args: ["--wrap=80"]
exclude: "docs/content/en/docs/Design/ml_with_heir\\.md$"
additional_dependencies:
- mdformat-gfm
- mdformat-frontmatter
- mdformat-footnote
# golang hooks
- repo: https://github.com/dnephin/pre-commit-golang
rev: "v0.5.1"
hooks:
- id: go-fmt
# python formatter
- repo: https://github.com/google/pyink
rev: 24.10.1
hooks:
- id: pyink
language_version: python3.11
- repo: local
hooks:
- id: disable-mdformat
name: Ensure google-internal mdformat is disabled on md files
entry: python3 scripts/disable_mdformat.py
language: system
types: [markdown]
pass_filenames: false # Run on all relevant files
always_run: true # Run the hook even if no files changed
exclude: patches/.*\.patch$