forked from DiamondLightSource/hyperion
-
Notifications
You must be signed in to change notification settings - Fork 0
Expand file tree
/
Copy path.pre-commit-config.yaml
More file actions
39 lines (37 loc) · 1.04 KB
/
Copy path.pre-commit-config.yaml
File metadata and controls
39 lines (37 loc) · 1.04 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
repos:
# Automatic source code formatting
- repo: https://github.com/psf/black
rev: 24.1.1
hooks:
- id: black
args: [--safe, --quiet]
files: \.pyi?$|SConscript$|^libtbx_config$
types: [file]
# 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 docs folder
language: fail
files: '.*\.png$'
exclude: '^docs/'
- id: ruff
name: Run ruff
stages: [commit]
language: system
entry: ruff check
types: [python]
# Syntax validation and some basic sanity checks
- repo: https://github.com/pre-commit/pre-commit-hooks
rev: v4.0.1
hooks:
- id: check-ast
- id: check-yaml
args: ["--allow-multiple-documents"]
- id: check-merge-conflict
- id: check-added-large-files
args: ["--maxkb=500"]
- id: no-commit-to-branch
name: "Don't commit to 'main'"