-
Notifications
You must be signed in to change notification settings - Fork 24
/
.pre-commit-config.yaml
55 lines (50 loc) · 2.14 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
---
default_language_version:
python: python3
exclude: ^(doc/_static/.*|doc/_themes/.*)$
repos:
- repo: https://github.com/pre-commit/pre-commit-hooks
rev: v4.5.0
hooks:
- id: check-merge-conflict # Check for files that contain merge conflict strings.
- id: trailing-whitespace # Trims trailing whitespace.
args:
- --markdown-linebreak-ext=md
- id: mixed-line-ending # Replaces or checks mixed line ending.
args:
- --fix=lf
- id: end-of-file-fixer # Makes sure files end in a newline and only a newline.
- id: check-ast # Simply check whether files parse as valid python.
- id: check-case-conflict # Check for files with names that would conflict on a
# case-insensitive filesystem like MacOS HFS+ or Windows FAT.
- id: check-json # Attempts to load all json files to verify syntax.
- id: check-symlinks # Checks for symlinks which do not point to anything.
- id: debug-statements # Check for debugger imports and py37+ breakpoint() calls in python source.
- id: fix-byte-order-marker # removes UTF-8 byte order marker
- id: forbid-submodules # forbids any submodules in the repository.
- id: fix-encoding-pragma # Remove `# -*- coding: utf-8 -*-` from the top of python files.
args:
- --remove
# ----- Code Formatting and Analysis ---------------------------------------------------------->
- repo: https://github.com/charliermarsh/ruff-pre-commit
rev: "v0.2.0"
hooks:
- id: ruff
args:
- --fix
exclude: (.pre-commit-hooks/.*|docs/.*)\.py
- repo: https://github.com/psf/black
rev: 24.1.1
hooks:
- id: black
args: [-l 100]
exclude: src/saf/version.py
- repo: https://github.com/asottile/blacken-docs
rev: 1.16.0
hooks:
- id: blacken-docs
args: [--skip-errors]
files: ^(docs/.*\.rst|.*\.py)$
additional_dependencies:
- black==24.1.1
# <---- Code Formatting and Analysis -----------------------------------------------------------