-
Notifications
You must be signed in to change notification settings - Fork 0
/
.pre-commit-config.yaml
72 lines (66 loc) · 3.54 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
repos:
- repo: https://github.com/psf/black
rev: 23.3.0
hooks:
- id: black
language: python
- repo: https://github.com/charliermarsh/ruff-pre-commit
# Ruff version.
rev: "v0.0.263"
hooks:
- id: ruff
- repo: https://github.com/pre-commit/pre-commit-hooks
rev: v4.4.0
hooks:
- id: check-added-large-files # Prevent giant files from being committed.
- id: check-ast # Simply check whether files parse as valid python
- id: check-builtin-literals # Require literal syntax when initializing empty or zero Python builtin types.
- 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-docstring-first # Checks for a common error of placing code before the docstring.
- id: check-executables-have-shebangs # Checks that non-binary executables have a proper shebang.
- id: check-merge-conflict # Check for files that contain merge conflict strings.
- id: check-shebang-scripts-are-executable # Checks that scripts with shebangs are executable.
- id: check-symlinks # Checks for symlinks which do not point to anything.
- id: check-toml # Attempts to load all TOML files to verify syntax.
- id: check-vcs-permalinks # Ensures that links to vcs websites are permalinks.
- id: check-xml # Attempts to load all xml files to verify syntax.
- id: check-yaml # Attempts to load all yaml files to verify syntax.
- id: debug-statements # Check for debugger imports and py37+ breakpoint() calls in python source.
- id: destroyed-symlinks # Detects symlinks which are changed to regular files with a content of a path which that symlink was pointing to.
- id: detect-private-key # Checks for the existence of private keys.
- id: end-of-file-fixer # Makes sure files end in a newline and only a newline.
- id: fix-byte-order-marker # Removes UTF-8 byte order marker
- id: fix-encoding-pragma # Add # -*- coding: utf-8 -*- to the top of python files.
- id: mixed-line-ending # Replaces or checks mixed line ending.
- id: name-tests-test # verifies that test files are named correctly.
args: [--pytest-test-first]
# - id: no-commit-to-branch # Protect specific branches from direct checkins.
# args: [--branch, main]
- id: requirements-txt-fixer # Sorts entries in requirements.txt and constraints.txt and removes incorrect entry for pkg-resources==0.0.0
- id: trailing-whitespace # Trims trailing whitespace.
args: [--markdown-linebreak-ext=md]
- repo: local
hooks:
- id: mypy
name: mypy
entry: bash -c 'mypy --warn-unused-configs --python-version 3.8 --show-error-context --show-column-numbers --show-error-end --show-error-codes --pretty rds_cep'
language: system
types: ["python"]
- repo: local
hooks:
- id: pytest
name: pytest
entry: bash -c 'python -m pytest'
language: system
types: ["python"]
exclude: ^venv/ ^.git/ ^.vscode/ ^.DS_Store
- repo: local
hooks:
- id: stubgen
name: stubgen
entry: bash -c 'stubgen -o . rds_cep'
language: system
types: ["python"]
exclude: ^venv/ ^.git/ ^.vscode/ ^.DS_Store
default_language_version:
python: python3.8