forked from dials/dials
-
Notifications
You must be signed in to change notification settings - Fork 0
/
Copy path.pre-commit-config.yaml
66 lines (61 loc) · 1.94 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
repos:
# Syntax validation and some basic sanity checks
- repo: https://github.com/pre-commit/pre-commit-hooks
rev: v4.1.0
hooks:
- id: check-merge-conflict
- id: check-ast
fail_fast: True
- id: check-json
- id: check-added-large-files
args: ['--maxkb=200']
- id: check-yaml
args: ['--allow-multiple-documents']
- id: no-commit-to-branch
name: "Don't commit to 'main' directly"
# Automatically sort imports
- repo: https://github.com/PyCQA/isort
rev: 5.12.0
hooks:
- id: isort
args: [
'-a', 'from __future__ import annotations', # 3.7-3.11
'--rm', 'from __future__ import absolute_import', # -3.0
'--rm', 'from __future__ import division', # -3.0
'--rm', 'from __future__ import generator_stop', # -3.7
'--rm', 'from __future__ import generators', # -2.3
'--rm', 'from __future__ import nested_scopes', # -2.2
'--rm', 'from __future__ import print_function', # -3.0
'--rm', 'from __future__ import unicode_literals', # -3.0
'--rm', 'from __future__ import with_statement', # -2.6
]
exclude: ^installer/
# Automatic source code formatting
- repo: https://github.com/psf/black
rev: 22.3.0
hooks:
- id: black
args: [--safe, --quiet]
files: \.pyi?$|SConscript$|^libtbx_config$
types: [file]
- repo: https://github.com/pre-commit/mirrors-clang-format
rev: v13.0.1
hooks:
- id: clang-format
files: \.c(c|pp|xx)?$|\.h(pp)?$
# Linting
- repo: https://github.com/PyCQA/flake8
rev: 4.0.1
hooks:
- id: flake8
additional_dependencies: ['flake8-comprehensions==3.8.0']
# Give a specific warning for added image files
- repo: local
hooks:
- id: no-images
name: Check for image files
entry: >
Images for documentation should go into the documentation repository
https://github.com/dials/dials.github.io
language: fail
files: '.*\.png$'