Skip to content

Instantly share code, notes, and snippets.

@elmerehbi
Last active July 29, 2020 14:18
Show Gist options
  • Star 0 You must be signed in to star a gist
  • Fork 0 You must be signed in to fork a gist
  • Save elmerehbi/9e125f0b526c2cc3015aa75d75c9c386 to your computer and use it in GitHub Desktop.
Save elmerehbi/9e125f0b526c2cc3015aa75d75c9c386 to your computer and use it in GitHub Desktop.
# https://pre-commit.com | https://pre-commit.com/hooks.html
default_language_version:
python: python3.7
repos:
- repo: https://github.com/pre-commit/pre-commit-hooks
rev: v2.5.0
hooks:
- id: detect-private-key
- id: trailing-whitespace
types: [python]
- id: check-yaml
- id: check-added-large-files
- id: end-of-file-fixer
types: [python]
- id: trailing-whitespace
- id: check-json
- id: check-toml
- id: check-yaml
- id: check-merge-conflict
- id: mixed-line-ending
- id: check-docstring-first
- repo: https://github.com/ambv/black
rev: stable
hooks:
- id: black
args: ["-l 80", "--diff"]
stages: [commit, push]
- repo: https://github.com/humitos/mirrors-autoflake
rev: v1.1
hooks:
- id: autoflake
args: ['--in-place', '--remove-all-unused-imports', '--remove-unused-variable']
stages: [push]
- repo: local
hooks:
- id: pytest
name: pytest
stages: [push]
entry: .venv/bin/pytest
language: script
pass_filenames: false
types: [python]
Sign up for free to join this conversation on GitHub. Already have an account? Sign in to comment