Skip to content

Commit

Permalink
Add pre-commit
Browse files Browse the repository at this point in the history
  • Loading branch information
danlamanna committed Jun 8, 2021
1 parent 426256b commit 2b88200
Show file tree
Hide file tree
Showing 2 changed files with 65 additions and 1 deletion.
5 changes: 4 additions & 1 deletion .github/workflows/ci.yml
Expand Up @@ -40,7 +40,7 @@ jobs:
- name: Install tox
run: |
pip install --upgrade pip
pip install tox
pip install tox pre-commit
- name: Run tests
run: |
tox
Expand All @@ -49,3 +49,6 @@ jobs:
DJANGO_MINIO_STORAGE_ENDPOINT: localhost:9000
DJANGO_MINIO_STORAGE_ACCESS_KEY: minioAccessKey
DJANGO_MINIO_STORAGE_SECRET_KEY: minioSecretKey
- name: Run pre-commit
run: |
pre-commit run --all-files
61 changes: 61 additions & 0 deletions .pre-commit-config.yaml
@@ -0,0 +1,61 @@
repos:
- repo: https://github.com/pre-commit/pre-commit-hooks
rev: v4.0.1
hooks:
- id: check-added-large-files
- id: check-ast
- id: check-executables-have-shebangs
- id: check-json
- id: check-merge-conflict
- id: check-shebang-scripts-are-executable
- id: check-symlinks
- id: check-toml
- id: check-yaml
- id: debug-statements
- id: detect-aws-credentials
args: [--allow-missing-credentials]
- id: detect-private-key
- id: end-of-file-fixer
- id: mixed-line-ending
- id: trailing-whitespace

- repo: https://github.com/pre-commit/pygrep-hooks
rev: v1.4.0
hooks:
- id: python-no-eval
- id: python-no-log-warn

- repo: https://github.com/myint/autoflake
rev: v1.4
hooks:
- id: autoflake
args: [--in-place, --remove-all-unused-imports, --remove-unused-variables]

- repo: https://github.com/asottile/pyupgrade
rev: v2.7.4
hooks:
- id: pyupgrade
args: [--py37-plus]

- repo: local
hooks:
- id: toxformat
name: tox -e format
entry: tox -e format
pass_filenames: true
language: system
types: [python]

- id: toxlint
name: tox -e lint
entry: tox -e lint
pass_filenames: true
language: system
types: [python]

- id: toxmigrations
name: tox -e check-migrations
entry: tox --skip-pkg-install -e check-migrations
pass_filenames: false
language: system
types: [python]

0 comments on commit 2b88200

Please sign in to comment.