Skip to content

Commit 81dc970

Browse files
committed
Add pre-commit
basic layout Signed-off-by: nstarman <nstarman@users.noreply.github.com>
1 parent caf1011 commit 81dc970

File tree

2 files changed

+57
-0
lines changed

2 files changed

+57
-0
lines changed

.pre-commit-config.yaml

Lines changed: 54 additions & 0 deletions
Original file line numberDiff line numberDiff line change
@@ -0,0 +1,54 @@
1+
ci:
2+
autofix_prs: false
3+
autoupdate_schedule: 'monthly'
4+
5+
repos:
6+
- repo: https://github.com/pre-commit/pre-commit-hooks
7+
rev: v4.4.0
8+
hooks:
9+
- id: check-added-large-files
10+
# Prevent giant files from being committed.
11+
- id: check-ast
12+
# Simply check whether files parse as valid python.
13+
- id: check-case-conflict
14+
# Check for files with names that would conflict on a case-insensitive
15+
# filesystem like MacOS HFS+ or Windows FAT.
16+
- id: check-json
17+
# Attempts to load all json files to verify syntax.
18+
- id: check-merge-conflict
19+
# Check for files that contain merge conflict strings.
20+
- id: check-symlinks
21+
# Checks for symlinks which do not point to anything.
22+
- id: check-toml
23+
# Attempts to load all TOML files to verify syntax.
24+
- id: check-xml
25+
# Attempts to load all xml files to verify syntax.
26+
- id: check-yaml
27+
# Attempts to load all yaml files to verify syntax.
28+
exclude: ".*(.github.*)$"
29+
- id: debug-statements
30+
# Check for debugger imports and py37+ breakpoint() calls in python
31+
# source.
32+
- id: detect-private-key
33+
# Checks for the existence of private keys.
34+
- id: end-of-file-fixer
35+
# Makes sure files end in a newline and only a newline.
36+
- id: trailing-whitespace
37+
# Trims trailing whitespace.
38+
exclude_types: [python]
39+
40+
- repo: https://github.com/pre-commit/pygrep-hooks
41+
rev: v1.10.0
42+
hooks:
43+
- id: python-check-mock-methods
44+
# Prevent common mistakes of assert mck.not_called(), assert
45+
# mck.called_once_with(...) and mck.assert_called.
46+
- id: text-unicode-replacement-char
47+
# Forbid files which have a UTF-8 Unicode replacement character.
48+
- id: python-check-blanket-noqa
49+
# Enforce that all noqa annotations always occur with specific codes.
50+
51+
- repo: https://github.com/psf/black-pre-commit-mirror
52+
rev: 23.7.0
53+
hooks:
54+
- id: black

pyproject.toml

Lines changed: 3 additions & 0 deletions
Original file line numberDiff line numberDiff line change
@@ -29,3 +29,6 @@ doc = [
2929
[build-system]
3030
requires = ["setuptools"]
3131
build-backend = "setuptools.build_meta"
32+
33+
[tool.black]
34+
line-length = 88

0 commit comments

Comments
 (0)