Skip to content

Instantly share code, notes, and snippets.

@SaiNikhileshReddy
Last active April 18, 2023 08:00
Show Gist options
  • Save SaiNikhileshReddy/3a68b30a9db910a834de14dd3563560d to your computer and use it in GitHub Desktop.
Save SaiNikhileshReddy/3a68b30a9db910a834de14dd3563560d to your computer and use it in GitHub Desktop.
Pre-commit Configuration File for Python and Notebook based projects
exclude: '^docs/conf.py'
repos:
- repo: https://github.com/pre-commit/pre-commit-hooks
rev: v4.4.0
hooks:
- id: trailing-whitespace
- id: check-added-large-files
- id: check-ast
- id: check-json
- id: check-merge-conflict
- id: check-xml
- id: check-yaml
- id: debug-statements
- id: end-of-file-fixer
- id: requirements-txt-fixer
- id: mixed-line-ending
args: ['--fix=auto'] # replace 'auto' with 'lf' to enforce Linux/Mac line endings or 'crlf' for Windows
- repo: https://github.com/PyCQA/isort
rev: 5.12.0
hooks:
- id: isort
# If you want to avoid flake8 errors due to unused vars or imports:
- repo: https://github.com/PyCQA/autoflake
rev: v2.0.2
hooks:
- id: autoflake
args: [
# --in-place,
--remove-all-unused-imports,
--remove-unused-variables,
]
- repo: https://github.com/psf/black
rev: 23.1.0
hooks:
- id: black
language_version: python3
- repo: https://github.com/PyCQA/flake8
rev: 6.0.0
hooks:
- id: flake8
# You can add flake8 plugins via `additional_dependencies`:
additional_dependencies: [flake8-bugbear]
- repo: https://github.com/pre-commit/mirrors-mypy
rev: v1.1.1
hooks:
- id: mypy
args: [--ignore-missing-imports]
# - repo: https://github.com/pycqa/pylint
# rev: pylint-2.17.1
# hooks:
# - id: pylint
Sign up for free to join this conversation on GitHub. Already have an account? Sign in to comment