Repository navigation
Expand file tree
/
Copy path.pre-commit-config.yaml
More file actions
66 lines (66 loc) · 2.19 KB
/
Copy path.pre-commit-config.yaml
File metadata and controls
66 lines (66 loc) · 2.19 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
# Install hooks with `pre-commit install`; run on all files with
# `pre-commit run --all-files`.
repos:
- repo: https://github.com/pre-commit/pre-commit-hooks
rev: v6.0.0
hooks:
- id: check-toml
- id: check-yaml
# Deliberately malformed YAML for negative tests; `mkdocs.yml` uses
# MkDocs' `!ENV` tag (the docs build checks it); Helm templates (not
# YAML before rendering) and their rendered snapshots
exclude: >-
(?x)^(
tests/test_files/invalid_conf\.yaml|
mkdocs\.yml|
(charts/[^/]+|examples/petstore/chart)/templates/.*|
charts/[^/]+/tests/__snapshots__/.*
)$
- id: end-of-file-fixer
- id: trailing-whitespace
args: [--markdown-linebreak-ext=md]
- repo: https://github.com/astral-sh/ruff-pre-commit
rev: v0.17.2
hooks:
- id: ruff-check
args: [--fix]
- id: ruff-format
# Same version as in `requirements/semgrep.txt` (checked by the lint job);
# rules and their tests in `.semgrep/`
- repo: https://github.com/semgrep/pre-commit
rev: v1.182.1
hooks:
- id: semgrep
args:
- --config=.semgrep
- --error
- --metrics=off
- --disable-version-check
- --quiet
- --skip-unknown-extensions
# The rule tests contain findings on purpose
exclude: ^\.semgrep/
- id: semgrep
alias: semgrep-test
name: semgrep rule tests
# semgrep finds no tests in hidden directories passed as targets
entry: >-
sh -c 'cd .semgrep &&
semgrep --test --metrics=off --disable-version-check --quiet .'
files: ^\.semgrep/
pass_filenames: false
- repo: local
hooks:
# Uses ast-grep of the dev dependencies (`pip install -e ".[dev]"`);
# rules in `.ast-grep/` (`sgconfig.yml`)
- id: ast-grep
name: ast-grep
entry: ast-grep scan
language: system
types: [python]
- id: ast-grep-test
name: ast-grep rule tests
entry: ast-grep test --skip-snapshot-tests
language: system
files: ^(sgconfig\.yml|\.ast-grep/)
pass_filenames: false