Skip to content

Commit d790f15

Browse files
committed
Add Pre-Commit Config
This adds pre-commit config which invokes sanity checks for the following: * Python Encoding Pragma * Lines with trailing white space * Merge conflict checks * Empty new-line a the end of files. * Remove debug statements * Check for exceedingly large files. * Check the Python AST (valid Python Code). * Check byte order markers. * Check file naming case conflicts. * Check docstrings in modules, functions and classes. * Check that executable files have appropriate shebang. * Check for file links outside the repository. * Check for mixed line endings (Windows vs Unix). * Check that test files are named correctly. * Check json file is valid format. * Check json files are pretty printed. * Check yaml file is valid format. * Check yaml files are pretty printed. * Check for private keys. * Run Black. * Remove tabs for spaces. * Remove control line feeds (we like Unix). Signed-off-by: David ML Brown Jr <[email protected]>
1 parent bfad866 commit d790f15

File tree

1 file changed

+38
-0
lines changed

1 file changed

+38
-0
lines changed

.pre-commit-config.yaml

+38
Original file line numberDiff line numberDiff line change
@@ -0,0 +1,38 @@
1+
repos:
2+
- repo: https://github.com/pre-commit/pre-commit-hooks
3+
rev: v4.3.0
4+
hooks:
5+
- id: fix-encoding-pragma
6+
- id: check-merge-conflict
7+
- id: end-of-file-fixer
8+
- id: debug-statements
9+
- id: check-added-large-files
10+
- id: check-ast
11+
- id: check-byte-order-marker
12+
- id: check-case-conflict
13+
- id: check-docstring-first
14+
- id: check-executables-have-shebangs
15+
types: [python]
16+
- id: check-vcs-permalinks
17+
- id: check-symlinks
18+
- id: mixed-line-ending
19+
- id: name-tests-test
20+
- id: check-json
21+
- id: pretty-format-json
22+
args:
23+
- --autofix
24+
- --top-keys=_id
25+
- id: check-yaml
26+
- id: sort-simple-yaml
27+
files: '.yaml$'
28+
- id: detect-private-key
29+
- id: trailing-whitespace
30+
- repo: https://github.com/psf/black
31+
rev: 22.8.0
32+
hooks:
33+
- id: black
34+
- repo: https://github.com/Lucas-C/pre-commit-hooks
35+
rev: v1.3.1
36+
hooks:
37+
- id: remove-tabs
38+
- id: remove-crlf

0 commit comments

Comments
 (0)