forked from mosaicml/composer
-
Notifications
You must be signed in to change notification settings - Fork 0
/
.pre-commit-config.yaml
134 lines (132 loc) · 3.36 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
112
113
114
115
116
117
118
119
120
121
122
123
124
125
126
127
128
129
130
131
132
133
134
default_language_version:
python: python3
repos:
- repo: https://github.com/astral-sh/ruff-pre-commit
# Ruff version.
rev: v0.2.2
hooks:
- id: ruff
args: [--fix, --exit-non-zero-on-fix]
- repo: https://github.com/google/yapf
rev: v0.32.0
hooks:
- id: yapf
name: yapf
description: "A formatter for Python files."
entry: yapf
args: [-i, -vv, -p] # inplace
language: python
types: [python]
additional_dependencies:
- "toml"
- repo: https://github.com/pycqa/isort
hooks:
- id: isort
rev: 5.12.0
# - repo: https://github.com/pycqa/pylint
# hooks:
# - id: pylint
# entry: pylint
# args: ['composer', 'examples', 'tests']
# language: python
# types: [python]
# require_serial: true
# rev: v2.12.2
- repo: https://github.com/PyCQA/pydocstyle
hooks:
- id: pydocstyle
name: pydocstyle
entry: pydocstyle
language: python
types: [python]
exclude: "(?:tests|.ci|composer\/algorithms|composer\/datasets|composer\/models)\/.*|composer\/trainer\/activation_checkpointing.py"
additional_dependencies:
- "toml"
rev: 6.1.1
- repo: https://github.com/adrienverge/yamllint.git
rev: v1.28.0
hooks:
- id: yamllint
name: yamllint
description: This hook runs yamllint.
entry: yamllint
language: python
types: [file, yaml]
- repo: https://github.com/pre-commit/pre-commit-hooks
rev: v4.1.0
hooks:
- id: check-added-large-files
- id: check-ast
- id: check-builtin-literals
- id: check-case-conflict
- id: check-docstring-first
- id: check-executables-have-shebangs
- id: check-json
- id: check-shebang-scripts-are-executable
- id: pretty-format-json
args:
- --autofix
- --no-sort-keys
- --indent=1
- --no-ensure-ascii
- id: check-merge-conflict
- id: check-symlinks
- id: check-toml
- id: check-vcs-permalinks
- id: check-xml
- id: check-yaml
- id: debug-statements
- id: destroyed-symlinks
- id: double-quote-string-fixer
- id: end-of-file-fixer
- id: fix-byte-order-marker
- id: mixed-line-ending
- id: trailing-whitespace
- repo: https://github.com/Lucas-C/pre-commit-hooks
rev: v1.5.4
hooks:
- id: insert-license
args:
- --license-filepath
- .pre-commit/FILE_HEADER
- --comment-style
- "#"
- --allow-past-years
types: [python]
exclude: "composer\/trainer\/activation_checkpointing.py"
- repo: https://github.com/kynan/nbstripout
rev: 0.5.0
hooks:
- id: nbstripout
types:
- "jupyter"
args:
# Strip all the metadata that vscode or colab may add to a notebook
- --strip-empty-cells
- --extra-keys
- >
metadata.colab metadata.interpreter metadata.accelerator
metadata.kernelspec metadata.language_info.version
cell.metadata.heading_collapsed metadata.name metadata.nbconvert_exporter
metadata.version metadata.vscode
- repo: local
hooks:
- id: pyright
name: pyright
entry: pyright
language: node
types: [python]
pass_filenames: false
args: [--warnings]
additional_dependencies: ["pyright@1.1.310"]
- repo: https://github.com/trufflesecurity/trufflehog.git
rev: v3.40.0
hooks:
- id: trufflehog
name: secret scan
entry: trufflehog filesystem ./
args:
- --only-verified
- --fail
- --exclude-paths=./.github/secrets/exclude.yaml
exclude: .ci\/release_tests\/.*