Skip to content

Commit

Permalink
🔧 add pre-comit config
Browse files Browse the repository at this point in the history
  • Loading branch information
brutus committed Aug 3, 2021
1 parent 886c3ee commit b117fb1
Show file tree
Hide file tree
Showing 2 changed files with 62 additions and 0 deletions.
4 changes: 4 additions & 0 deletions .editorconfig
Original file line number Diff line number Diff line change
Expand Up @@ -12,6 +12,10 @@ trim_trailing_whitespace = true
indent_size = 4
indent_style = tab

[*.yaml]
indent_size = 2
indent_style = space

[*.js]
indent_size = 2

Expand Down
58 changes: 58 additions & 0 deletions .pre-commit-config.yaml
Original file line number Diff line number Diff line change
@@ -0,0 +1,58 @@
---
# INSTALL .: `pre-commit install --overwrite --install-hooks`
# UPDATE ..: `pre-commit autoupdate`
default_language_version:
python: python3.8
exclude: '\.svg$'
repos:
- repo: https://github.com/pre-commit/pre-commit-hooks
rev: v4.0.1
hooks:
# Generall Stuff
- id: trailing-whitespace
- id: mixed-line-ending
args:
- "--fix=lf"
- id: end-of-file-fixer
# VCS
- id: check-merge-conflict
# Config / Data Files
- id: check-yaml
# Python
- id: debug-statements
- id: requirements-txt-fixer
# Prettier (HTML, JS, CSS, Markdown…)
- repo: https://github.com/pre-commit/mirrors-prettier
rev: v2.3.2
hooks:
- id: prettier
# exclude HTML templates (no Jinja2 support)
exclude: 'source/_templates/.*\.html'
# YAML
- repo: https://github.com/adrienverge/yamllint.git
rev: v1.26.1
hooks:
- id: yamllint
# Python: check syntax
- repo: https://github.com/pycqa/flake8
rev: 3.9.2
hooks:
- id: flake8
args:
- "--select=F"
# Python: reorder imports
- repo: https://github.com/asottile/reorder_python_imports
rev: v2.6.0
hooks:
- id: reorder-python-imports
args:
- "--application-directories=.:source"
- "--py38-plus"
# Python: lint with black
- repo: https://github.com/psf/black
rev: 21.7b0
hooks:
- id: black
args:
- "--line-length=88"
- "--target-version=py38"

0 comments on commit b117fb1

Please sign in to comment.