-
Notifications
You must be signed in to change notification settings - Fork 1
/
.pre-commit-config.yaml
115 lines (107 loc) · 3.73 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
---
minimum_pre_commit_version: 2.13.0
exclude: ^requirements.*\.lock$
repos:
- repo: meta
hooks:
- id: check-hooks-apply
- id: check-useless-excludes
# pre-commit-hooks
- repo: https://github.com/pre-commit/pre-commit-hooks
rev: v5.0.0
hooks:
# Prevent giant files from being committed.
- id: check-added-large-files
# Simply check whether files parse as valid python.
- id: check-ast
# Require literal syntax when initializing empty or zero Python builtin
# types.
- id: check-builtin-literals
# Forbid files which have a UTF-8 byte-order marker
- id: fix-byte-order-marker
# Check for files with names that would conflict on a case-insensitive
# filesystem like MacOS HFS+ or Windows FAT.
- id: check-case-conflict
# Checks for a common error of placing code before the docstring.
- id: check-docstring-first
# check-executables-have-shebangs
# - id: check-executables-have-shebangs
# Attempts to load all json files to verify syntax.
# - id: check-json
# Check for files that contain merge conflict strings.
- id: check-merge-conflict
# Checks for symlinks which do not point to anything.
# - id: check-symlinks
# Attempts to load all TOML files to verify syntax.
- id: check-toml
# Ensures that links to vcs websites are permalinks.
- id: check-vcs-permalinks
# Attempts to load all xml files to verify syntax.
# - id: check-xml
# Attempts to load all yaml files to verify syntax.
- id: check-yaml
# Check for debugger imports and breakpoint() calls in python source.
- id: debug-statements
# Detects symlinks which are changed to regular files with a content
- id: destroyed-symlinks
# Checks for the existence of AWS secrets, set up with the AWS CLI.
# - id: detect-aws-credentials
# Checks for the existence of private keys.
- id: detect-private-key
# This hook replaces double quoted strings with single quoted strings.
# - id: double-quote-string-fixer (KEEP DISABLED)
# Makes sure files end in a newline and only a newline.
- id: end-of-file-fixer
# Removes "# -*- coding: utf-8 -*-" on the top of python files.
- id: fix-encoding-pragma
args: ["--remove"]
# Sort the lines in specified files (defaults to alphabetical).
# - id: file-contents-sorter (KEEP DISABLED)
# Replaces or checks mixed line ending to LF.
- id: mixed-line-ending
args: ["--fix=lf"]
# Assert that files in tests/ match test*.py.
- id: name-tests-test
args: ["--django"]
# Protect specific branches from direct checkins.
- id: no-commit-to-branch
args:
- "-b master"
- "-p release/.*"
- id: trailing-whitespace
- repo: https://github.com/astral-sh/ruff-pre-commit
# Ruff version.
rev: v0.6.9
hooks:
- id: ruff # Linter
args: [--fix]
- id: ruff-format # Formatter
# static type checking with mypy
- repo: https://github.com/pre-commit/mirrors-mypy
rev: v1.11.2
hooks:
- id: mypy
additional_dependencies:
- types-setuptools
- types-toml
- types-requests
- types-tabulate
- types-paramiko
- types-attrs
- repo: https://github.com/econchick/interrogate
rev: 1.7.0
hooks:
- id: interrogate
args: [tests]
language_version: python3.10
# vulture
- repo: https://github.com/jendrikseipp/vulture
rev: "v2.13"
hooks:
- id: vulture
# pycln
- repo: https://github.com/hadialqattan/pycln
rev: v2.4.0
hooks:
- id: pycln
args: [--config=pyproject.toml]