forked from redpanda-data/redpanda
-
Notifications
You must be signed in to change notification settings - Fork 0
Expand file tree
/
Copy path.pre-commit-config.yaml
More file actions
60 lines (52 loc) · 1.88 KB
/
.pre-commit-config.yaml
File metadata and controls
60 lines (52 loc) · 1.88 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
# Pre-commit hooks for Redpanda project
# See https://pre-commit.com for more information
# See https://pre-commit.com/hooks.html for more hooks
default_language_version:
python: python3
repos:
# Python formatting and linting
- repo: https://github.com/astral-sh/ruff-pre-commit
rev: v0.12.10
hooks:
# checked in CI by lint-python.yml
- id: ruff-check
args: [--fix, --exit-non-zero-on-fix]
files: '^tests/.*\.pyi?$'
# checked in CI by lint-python.yml
- id: ruff-format
# Shell script formatting
- repo: https://github.com/scop/pre-commit-shfmt
rev: v3.12.0-2
hooks:
- id: shfmt
# args should be kept in sync with vtools/taskfiles/lint.yml
# except that we add -d to provide some feedback about the error
args: ['-i', '2', '-ci', '-s', '-w', '-d']
# Local hooks
- repo: local
hooks:
# runs python type checking (same as task rp:type-check) but only in
# manual mode for now as it's too slow for pre-commit for now
- id: python-type-check
name: Python type checking (pyright)
entry: env TC_DOCKER_ARGS=--quiet tools/type-checking/type-check.sh pre-commit
language: system
stages: [manual]
files: '(tests/rptest/.*\.py$)|(tools/type-checking/.*)'
- id: clang-format
name: C++ formatting (clang-format)
entry: ./tools/clang-format -i
language: script
types_or: [c++, c, proto]
- id: bazel/buildifier
name: Bazel formatting
entry: bazel run //tools:buildifier.fix
language: system
files: '^MODULE.bazel$|^BUILD$|/BUILD$|\.(BUILD|bzl)$'
pass_filenames: false
- id: copyright-year
name: Copyright year check for new files
entry: tools/check-copyright-year.sh
language: script
files: '\.(cc|h|py|go|java|sh)$'
pass_filenames: false