Repository navigation
Expand file tree
/
Copy path.pre-commit-config.yaml
More file actions
59 lines (56 loc) · 1.94 KB
/
Copy path.pre-commit-config.yaml
File metadata and controls
59 lines (56 loc) · 1.94 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
# See https://pre-commit.com for more information
# See https://pre-commit.com/hooks.html for more hooks
# Install
# 1. pip install pre-commit
# 2. pre-commit install(the first time you download the repo, it will be cached for future use)
# Vendored code is linted upstream; keep hooks focused on Primus-owned paths.
exclude: ^third_party/
repos:
- repo: https://github.com/pre-commit/pre-commit-hooks
rev: v4.0.1
hooks:
- id: trailing-whitespace
- id: end-of-file-fixer
- id: check-yaml
- id: check-added-large-files
- id: check-merge-conflict
- repo: https://github.com/pycqa/isort
rev: 5.13.2
hooks:
- id: isort
args: ["--profile", "black"]
- repo: https://github.com/PyCQA/autoflake
rev: v2.3.1
hooks:
- id: autoflake
args:
[
"--remove-all-unused-imports",
"--remove-unused-variables",
"--expand-star-imports",
"--ignore-init-module-imports",
"--recursive",
"--in-place",
]
# Using this mirror lets us use mypyc-compiled black, which is about 2x faster
- repo: https://github.com/psf/black-pre-commit-mirror
rev: 24.8.0
hooks:
- id: black
args: ["--verbose", "--line-length=110"]
- repo: https://github.com/shellcheck-py/shellcheck-py
rev: v0.10.0.1
hooks:
- id: shellcheck
- repo: local
hooks:
# Keep the committed primus/_thirdparty.lock in sync with the submodule
# pins. always_run because a submodule bump changes a gitlink, not a file
# pre-commit would otherwise match; if the lock changes the commit fails so
# the regenerated lock gets staged. Mirrors the release CI drift check.
- id: thirdparty-lock
name: regenerate primus/_thirdparty.lock from submodule pins
entry: python tools/pip_index/gen_thirdparty_lock.py
language: system
pass_filenames: false
always_run: true