forked from facebookresearch/habitat-sim
-
Notifications
You must be signed in to change notification settings - Fork 3
/
.pre-commit-config.yaml
132 lines (117 loc) · 3.65 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
exclude: 'build|data/datasets|data/scene_datasets|node_modules/|src/deps|src/obsolete'
default_language_version:
python: python3
repos:
- repo: https://github.com/pre-commit/pre-commit-hooks
rev: v3.4.0
hooks:
- id: trailing-whitespace
- id: check-added-large-files
args: ['--maxkb=2000']
- id: end-of-file-fixer
- id: check-case-conflict
- id: check-docstring-first
- id: check-executables-have-shebangs
- id: check-json
# The JSONs below support comments (against spec)
exclude: ^(.eslintrc.json|tsconfig.json)
- id: check-merge-conflict
- id: check-toml
- id: check-yaml
- id: debug-statements
- id: mixed-line-ending
args: ['--fix=lf']
- id: requirements-txt-fixer
- repo: https://github.com/macisamuele/language-formatters-pre-commit-hooks
rev: v2.0.0
hooks:
- id: pretty-format-ini
args: [--autofix]
- id: pretty-format-toml
args: [--autofix]
- repo: https://github.com/timothycrosley/isort
rev: 5.7.0
hooks:
- id: isort
exclude: docs/
additional_dependencies: [toml]
- repo: https://github.com/ambv/black
rev: 20.8b1
hooks:
- id: black
exclude: ^examples/tutorials/(nb_python|colabs)
- repo: https://github.com/myint/autoflake
rev: v1.4
hooks:
- id: autoflake
args: ['--expand-star-imports', '--ignore-init-module-imports', '--in-place']
exclude: docs/
- repo: https://gitlab.com/pycqa/flake8
rev: 3.8.4
hooks:
- id: flake8
exclude: docs/
additional_dependencies:
- flake8-bugbear==20.1.4
- flake8-builtins==1.5.3
- flake8-comprehensions==3.3.0
- flake8-return==1.1.2
- flake8-simplify==0.11.0
- repo: https://github.com/pre-commit/mirrors-mypy
rev: 'v0.800'
hooks:
- id: mypy
pass_filenames: false
- repo: https://github.com/seddonym/import-linter
rev: v1.2.1
hooks:
- id: import-linter
- repo: https://github.com/kynan/nbstripout
rev: 0.3.9
hooks:
- id: nbstripout
files: '.ipynb'
- repo: local
hooks:
- id: jupytext-sync
name: Sync scripts and notebooks
files: '^examples/tutorials/(colabs|nb_python)/(.*\.py|.*\.ipynb)$'
entry: jupytext --update-metadata '{"jupytext":{"notebook_metadata_filter":"all", "cell_metadata_filter":"-all"}, "accelerator":"GPU"}' --set-formats 'nb_python//py:percent,colabs//ipynb' --pipe black --pipe 'isort - --treat-comment-as-code "# %%"' --pipe-fmt 'py:percent' --sync
pass_filenames: true
additional_dependencies:
- 'jupytext==1.6.0'
- 'nbformat<=5.0.8'
- black
- isort
always_run: false
language: python
require_serial: true
- repo: local
hooks:
- id: clang-format
name: Run clang-format
exclude: src/deps
entry: clang-format -i -style=file
types: [text]
files: '.*\.(cpp|h|hpp|cu|cuh)$'
language: system
- repo: https://github.com/cheshirekow/cmake-format-precommit
rev: v0.6.13
hooks:
- id: cmake-format
exclude: (^src/(cmake/Find|deps)|configure\.h\.cmake$)
- repo: https://github.com/pre-commit/mirrors-eslint
rev: v7.18.0
hooks:
- id: eslint
args: [--fix, --ext .html,.js]
additional_dependencies:
- repo: https://github.com/shellcheck-py/shellcheck-py
rev: v0.7.1.1
hooks:
- id: shellcheck