Skip to content

Commit

Permalink
Add pre-commit configuration
Browse files Browse the repository at this point in the history
  • Loading branch information
Jackenmen committed May 30, 2021
1 parent 9f5e48a commit 4c8168b
Showing 1 changed file with 55 additions and 0 deletions.
55 changes: 55 additions & 0 deletions .pre-commit-config.yaml
Original file line number Diff line number Diff line change
@@ -0,0 +1,55 @@
default_language_version:
python: python3.8
exclude: ^.stubs/
repos:
- repo: https://github.com/psf/black
rev: '20.8b1'
hooks:
- id: black
- repo: https://github.com/Pierre-Sassoulas/black-disable-checker
rev: '1.0.1'
hooks:
- id: black-disable-checker
- repo: https://gitlab.com/pycqa/flake8
rev: '3.9.0'
hooks:
- id: flake8
- repo: https://github.com/pre-commit/pre-commit-hooks
rev: v3.4.0
hooks:
# `.gitattributes` should technically already handle this
# but autocrlf can result in local files keeping the CRLF
# which is problematic for codespell
- id: end-of-file-fixer
# normally you would want this but Neuro is not very consistent :P
# - id: mixed-line-ending
# args:
# - "--fix=lf"

# Trailing whitespace is evil
- id: trailing-whitespace

# Require literal syntax when initializing builtin types
- id: check-builtin-literals

# Ensure that links to code on GitHub use the permalinks
- id: check-vcs-permalinks

# Syntax validation
- id: check-ast
- id: check-json
- id: check-toml
# can be switched to yamllint when this issue gets resolved:
# https://github.com/adrienverge/yamllint/issues/238
- id: check-yaml

# JSON auto-formatter
- id: pretty-format-json
args:
- "--autofix"
- "--indent=4"
- "--no-sort-keys"

# Checks for git-related issues
- id: check-case-conflict
- id: check-merge-conflict

0 comments on commit 4c8168b

Please sign in to comment.