Skip to content

Commit

Permalink
Update .pre-commit-config.yaml
Browse files Browse the repository at this point in the history
  • Loading branch information
entorb committed Jan 25, 2024
1 parent 2eb7caa commit 899498b
Showing 1 changed file with 21 additions and 81 deletions.
102 changes: 21 additions & 81 deletions .pre-commit-config.yaml
Original file line number Diff line number Diff line change
@@ -1,21 +1,26 @@
# install
# install package
# pip3 install pre-commit
# run
# pre-commit run -a
# register as git commit-hook to run automatically
# pre-commit install
# run manually
# pre-commit run --all-files
# or
# pre-commit run --files myFile1.py myFile2.py
# update hooks to latest version
# pre-commit autoupdate

# ruff replaces flake8, pyupgrade, and autoflake
# ruff-format replaces black, isort, add-trailing-comma

exclude: |
(?x)^(
scripts/ebook/v1.*|
)$
repos:
- repo: https://github.com/pre-commit/pre-commit-hooks
rev: v4.4.0
rev: v4.5.0
hooks:
# see https://github.com/pre-commit/pre-commit-hooks
- id: check-added-large-files
args: ["--maxkb=500"]
- id: check-ast
Expand All @@ -28,6 +33,7 @@ repos:
- id: check-shebang-scripts-are-executable
- id: check-symlinks
- id: check-toml
- id: check-vcs-permalinks
- id: check-xml
- id: check-yaml
- id: debug-statements
Expand All @@ -44,52 +50,23 @@ repos:
- id: forbid-new-submodules
# - id: forbid-submodules
# args: ['--fix=lf']
- id: mixed-line-ending
- id: name-tests-test
# - id: no-commit-to-branch
# args: [--branch, staging]
- id: pretty-format-json
args: ["--autofix"]
# not, since it decodes utf-8
# - id: pretty-format-json
# args: ["--autofix"]
- id: requirements-txt-fixer
# - id: sort-simple-yaml
- id: trailing-whitespace

- repo: https://github.com/igorshubovych/markdownlint-cli
rev: v0.34.0
hooks:
- id: markdownlint
args: ["--disable", "MD013"]

# - repo: https://github.com/markdownlint/markdownlint
# rev: v0.12.0
# hooks:
# - id: markdownlint

- repo: https://github.com/charliermarsh/ruff-pre-commit
rev: "v0.0.272"
rev: "v0.1.14"
hooks:
- id: ruff
args: [--fix, --exit-non-zero-on-fix]

- repo: https://github.com/asottile/add-trailing-comma
rev: v2.5.1
hooks:
- id: add-trailing-comma

- repo: https://github.com/psf/black
rev: 23.3.0
hooks:
- id: black

- repo: https://github.com/PyCQA/isort
rev: 5.12.0
hooks:
- id: isort

# no, black is enough
# - repo: https://github.com/pre-commit/mirrors-autopep8
# rev: v2.0.1
# hooks:
# - id: autopep8
- id: ruff-format

- repo: https://github.com/pre-commit/pygrep-hooks
rev: v1.10.0
Expand All @@ -106,48 +83,11 @@ repos:
- id: rst-inline-touching-normal
- id: text-unicode-replacement-char

# problem: collides with black. since it splits multiple 'from imports'
# - repo: https://github.com/asottile/reorder_python_imports
# rev: v3.9.0
# hooks:
# - id: reorder-python-imports

- repo: https://github.com/asottile/pyupgrade
rev: v3.7.0
hooks:
- id: pyupgrade
args: ["--py310-plus"]

- repo: https://github.com/pycqa/flake8
rev: 6.0.0
- repo: https://github.com/igorshubovych/markdownlint-cli
rev: v0.38.0
hooks:
- id: flake8
additional_dependencies:
# NOTE: entries are copy of .flake8-config-file -> for auto-install
# Bugs
- flake8-bugbear
- flake8-secure-coding-standard
- flake8-bandit
- flake8-builtins

# Clean Code
- flake8-comprehensions
- flake8-simplify
# - flake8-eradicate
- flake8-commas

# Limitations
- flake8-blind-except
- flake8-logging-format
# - flake8-print

# Documentation
- flake8-comments
- flake8-docstrings
- flake8-rst-docstrings

# Test-Improvements
- flake8-assertive
- id: markdownlint
args: ["--disable", "MD013"]

default_language_version:
python: python3.10

0 comments on commit 899498b

Please sign in to comment.