Skip to content

Instantly share code, notes, and snippets.

@JoneSabino
Created December 31, 2024 16:15
Show Gist options
  • Save JoneSabino/7fcf1363b58cc5a1f75026f5a3a0bd23 to your computer and use it in GitHub Desktop.
Save JoneSabino/7fcf1363b58cc5a1f75026f5a3a0bd23 to your computer and use it in GitHub Desktop.
Transitory and flexible linting setup
repos:
- repo: https://github.com/myint/autoflake
rev: v2.3.1
hooks:
- id: autoflake
args:
- --in-place
- --remove-all-unused-imports
- --remove-unused-variables
- --exclude='.venv/'
language_version: python3.11
pass_filenames: true
stages: [commit]
- repo: https://github.com/pycqa/isort
rev: 5.13.2
hooks:
- id: isort
language_version: python3.11
- repo: https://github.com/python/black.git
rev: 24.10.0
hooks:
- id: black
language_version: python3.11
pass_filenames: true
stages: [commit]
- repo: https://github.com/pycqa/flake8.git
rev: 7.1.1
hooks:
- id: flake8
name: Flake8 Strict
language_version: python3.11
additional_dependencies:
- flake8-pyproject==1.2.3
- flake8-docstrings==1.7.0
- flake8-thoughtful==0.1.0
- flake8-annotations==3.1.1
- id: flake8
name: Flake8 Non-Blocker
language_version: python3.11
additional_dependencies:
- flake8-bugbear==24.12.12
- flake8-simplify==0.21.0
- flake8-comprehensions==3.16.0
args:
- --select=B,C4,SIM
- exit-zero
stages: [manual]
- repo: https://github.com/pre-commit/mirrors-mypy
rev: v1.14.0
hooks:
- id: mypy
language_version: python3.11
args:
- --config-file=pyproject.toml
- repo: https://github.com/jendrikseipp/vulture
rev: v2.14
hooks:
- id: vulture
language_version: python3.11
args:
- src
- tests
- --exclude=.venv,.git,.mypy_cache,.pytest_cache,.trunk,.vscode,.idea,output,temp
- repo: https://github.com/jendrikseipp/vulture
rev: v2.14
hooks:
- id: vulture
name: Vulture (report dead code)
entry: python run_vulture.py
language: python
pass_filenames: false
verbose: true
- repo: https://bitbucket.org/thoughtfulautomation/ta-commit-secure.git
rev: 0.1.3
hooks:
- id: ta-commit-secure
language_version: python3.11
Sign up for free to join this conversation on GitHub. Already have an account? Sign in to comment