forked from semgrep/semgrep
-
Notifications
You must be signed in to change notification settings - Fork 0
/
.pre-commit-config.yaml
111 lines (100 loc) · 3.46 KB
/
.pre-commit-config.yaml
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
101
102
103
104
105
106
107
108
109
110
111
exclude: "^semgrep/tests/e2e/(targets|snapshots)|semgrep-core/tests|.*\\.md"
repos:
- repo: https://github.com/pre-commit/pre-commit-hooks
rev: v3.3.0
hooks:
- id: check-yaml
args: [--allow-multiple-documents]
exclude: ^semgrep\/tests\/.+$|^perf\/bench\/gitlab-rules\/.+$$
- id: end-of-file-fixer
- id: trailing-whitespace
args: [--markdown-linebreak-ext=md]
- id: check-case-conflict
- id: check-added-large-files
- id: check-executables-have-shebangs
- id: check-merge-conflict
- id: check-symlinks
- id: fix-byte-order-marker
- repo: https://github.com/psf/black
rev: 20.8b1
hooks:
- id: black
- repo: https://github.com/asottile/reorder_python_imports
rev: v2.3.6
hooks:
- id: reorder-python-imports
args: [--py36-plus]
- repo: https://github.com/pre-commit/mirrors-mypy
rev: "v0.790"
hooks:
- id: mypy
exclude: ^semgrep\/tests\/.+$|^setup.py$|^scripts\/.+$|^parsing-stats\/.+$|^perf\/.+$$
args: [--config, mypy.ini, --show-error-codes]
- id: mypy
alias: mypy-test
name: mypy (test files)
files: ^semgrep\/tests\/.+$
args: [--config, mypy-tests.ini, --show-error-codes]
- repo: https://gitlab.com/pycqa/flake8
rev: "3.8.4"
hooks:
- id: flake8
additional_dependencies: ["flake8-bugbear==20.1.4"]
args: ["--select=B,E9,F4,F63,F7,F82"]
- repo: https://github.com/returntocorp/semgrep
rev: 'v0.43.0'
hooks:
- id: semgrep
name: Semgrep Python
types: [python]
exclude: "^semgrep/tests/.+$|^scripts/.+$|^semgrep/setup.py$"
args: ['--config', 'https://semgrep.dev/p/python', '--error']
- id: semgrep
name: Semgrep Bandit
types: [python]
exclude: "^semgrep/tests/.+$|^scripts/.+$|^semgrep/setup.py$"
args: ['--config', 'https://semgrep.dev/p/bandit', '--error']
- repo: local
hooks:
- id: shellcheck
name: shellcheck
language: docker_image
entry: koalaman/shellcheck:v0.7.1
files: "[.]sh$"
- repo: local
hooks:
- id: hadolint
name: hadolint
language: docker_image
files: "Dockerfile"
entry: hadolint/hadolint:v1.18.0 hadolint
args: ["--ignore", "DL3008", "--ignore", "DL3018"]
# Run develop semgrep. Only used in CI
# To run locally use `pre-commit run --hook-stage manual semgrep-docker-develop`
- repo: https://github.com/returntocorp/semgrep
rev: 'v0.43.0'
hooks:
- id: semgrep-docker-develop
name: Semgrep Develop Python
types: [python]
exclude: "^semgrep/tests/.+$|^scripts/.+$|^semgrep/setup.py$"
args: ['--config', 'https://semgrep.dev/p/python', '--error']
stages: [manual]
- id: semgrep-docker-develop
name: Semgrep Develop Bandit
types: [python]
exclude: "^semgrep/tests/.+$|^scripts/.+$|^semgrep/setup.py$"
args: ['--config', 'https://semgrep.dev/p/bandit', '--error']
stages: [manual]
# Reformat OCaml code (ml, mli) with ocamlformat if ocamlformat is
# present. If ocamlformat is missing, this step will succeed.
# This allows pure python users to run 'pre-commit run --all' without
# installing opam and ocamlformat.
#
- repo: local
hooks:
- id: lint-ocaml
name: Reformat OCaml code
entry: ./scripts/lint-ocaml
language: script
files: "\\.mli?$"