Skip to content

Commit

Permalink
Add pre-commit
Browse files Browse the repository at this point in the history
  • Loading branch information
asvetlov committed Nov 30, 2021
1 parent cf5c783 commit 6faa3a2
Show file tree
Hide file tree
Showing 3 changed files with 69 additions and 6 deletions.
61 changes: 61 additions & 0 deletions .pre-commit-config.yaml
Original file line number Diff line number Diff line change
@@ -0,0 +1,61 @@
repos:
- repo: https://github.com/pre-commit/pre-commit-hooks
rev: 'v4.0.1'
hooks:
- id: check-merge-conflict
- repo: https://github.com/asottile/yesqa
rev: v1.3.0
hooks:
- id: yesqa
- repo: https://github.com/PyCQA/isort
rev: '5.10.0'
hooks:
- id: isort
- repo: https://github.com/psf/black
rev: '21.10b0'
hooks:
- id: black
language_version: python3 # Should be a command that runs python3.6+
- repo: https://github.com/pre-commit/pre-commit-hooks
rev: 'v4.0.1'
hooks:
- id: end-of-file-fixer
- id: requirements-txt-fixer
- id: trailing-whitespace
- id: file-contents-sorter
files: |
docs/spelling_wordlist.txt|
.gitignore|
.gitattributes
- id: check-case-conflict
- id: check-json
- id: check-xml
- id: check-executables-have-shebangs
- id: check-toml
- id: check-xml
- id: check-yaml
- id: debug-statements
- id: check-added-large-files
- id: check-symlinks
- id: debug-statements
- id: detect-aws-credentials
args: ['--allow-missing-credentials']
- id: detect-private-key
exclude: ^examples/
- repo: https://github.com/asottile/pyupgrade
rev: 'v2.29.0'
hooks:
- id: pyupgrade
args: ['--py36-plus']
- repo: https://github.com/PyCQA/flake8
rev: '4.0.1'
hooks:
- id: flake8
exclude: "^docs/"

- repo: git://github.com/Lucas-C/pre-commit-hooks-markup
rev: v1.0.1
hooks:
- id: rst-linter
files: >-
^[^/]+[.]rst$
1 change: 1 addition & 0 deletions Makefile
Original file line number Diff line number Diff line change
Expand Up @@ -18,6 +18,7 @@ develop:
install:
@pip install -U pip
@pip install -Ur requirements/dev.txt
pre-commit install

create-tar:
@tar -cvf tests/docker/docker_context.tar -C tests/docker/tar/ .
Expand Down
13 changes: 7 additions & 6 deletions requirements/test.txt
Original file line number Diff line number Diff line change
@@ -1,9 +1,10 @@
pytest==6.2.5
pytest-cov==3.0.0
pytest-asyncio==0.16.0
flake8==4.0.1
mypy==0.910
-r ci.txt
black==21.11b1
flake8==4.0.1
isort==5.10.1
mypy==0.910
packaging==21.3
-r ci.txt
pre-commit==2.15.0
pytest==6.2.5
pytest-asyncio==0.16.0
pytest-cov==3.0.0

0 comments on commit 6faa3a2

Please sign in to comment.