Skip to content

Commit

Permalink
Initial commit 3
Browse files Browse the repository at this point in the history
  • Loading branch information
HenningRose committed Jan 13, 2025
1 parent 802cb88 commit b563ea8
Showing 1 changed file with 53 additions and 16 deletions.
69 changes: 53 additions & 16 deletions .pre-commit-config.yaml
Original file line number Diff line number Diff line change
@@ -1,10 +1,11 @@
default_language_version:
python: python3
exclude: 'ach_model.py'

repos:
- repo: https://github.com/pre-commit/pre-commit-hooks
rev: v4.3.0
hooks:
# list of supported hooks: https://pre-commit.com/hooks.html
- id: trailing-whitespace
- id: end-of-file-fixer
- id: check-docstring-first
Expand All @@ -13,19 +14,38 @@ repos:
- id: detect-private-key
- id: check-toml
- id: check-case-conflict
# - id: check-executables-have-shebangs
#- id: check-added-large-files

# python code formatting
# - repo: https://github.com/psf/black
# rev: 22.6.0
# hooks:
# - id: black
# args: [--line-length, "99"]

# python import sorting
- repo: https://github.com/PyCQA/isort
rev: 5.12.0
hooks:
- id: isort
args: ["--profile", "black", "--filter-files"]

# python upgrading syntax to newer version
- repo: https://github.com/asottile/pyupgrade
rev: v2.32.1
hooks:
- id: pyupgrade
args: [--py38-plus]

# python docstring formatting
- repo: https://github.com/myint/docformatter
rev: v1.4
hooks:
- id: docformatter
args: [--in-place, --wrap-summaries=99, --wrap-descriptions=99]

# python check (PEP8), programming errors and code complexity
- repo: https://github.com/PyCQA/flake8
rev: 4.0.1
hooks:
Expand All @@ -38,28 +58,51 @@ repos:
"logs/*,data/*",
]

# python security linter
- repo: https://github.com/PyCQA/bandit
rev: "1.7.1"
hooks:
- id: bandit
args: ["-s", "B101"]

# yaml formatting
#- repo: https://github.com/pre-commit/mirrors-prettier
# rev: v2.1.0
# hooks:
# - id: prettier
# types: [yaml]

# shell scripts linter
# - repo: https://github.com/shellcheck-py/shellcheck-py
# rev: "v0.9.0.5"
# hooks:
# - id: shellcheck
#

- repo: https://github.com/astral-sh/ruff-pre-commit
# Ruff version.
rev: v0.1.7
hooks:
# Run the linter.
- id: ruff
args: [--fix]
args: [ --fix ]
# Run the formatter.
- id: ruff-format

# md formatting
- repo: https://github.com/executablebooks/mdformat
rev: 0.7.16
rev: 0.7.14
hooks:
- id: mdformat
args: ["--number"]
additional_dependencies:
- mdformat-gfm==0.3.5
- linkify-it-py==1.0.3
- markdown-it-py==2.2.0
- mdformat-gfm
- mdformat-tables
- mdformat_frontmatter
# - mdformat-toc
# - mdformat-black

# word spelling linter
- repo: https://github.com/codespell-project/codespell
rev: v2.1.0
hooks:
Expand All @@ -68,12 +111,14 @@ repos:
- --skip=logs/**,data/**,*.ipynb
- --ignore-words-list=hist,circularly,ot

# jupyter notebook cell output clearing
- repo: https://github.com/kynan/nbstripout
rev: 0.5.0
hooks:
- id: nbstripout
args: ["--strip-empty-cells"]
args: ["--install", "--attributes", ".gitattributes"]

# jupyter notebook linting
- repo: https://github.com/nbQA-dev/nbQA
rev: 1.4.0
hooks:
Expand All @@ -86,12 +131,4 @@ repos:
[
"--extend-ignore=E203,E402,E501,F401,F841",
"--exclude=logs/*,data/*",
]

- repo: local # Adding this to handle `docs/requirements.txt` gracefully
hooks:
- id: skip-missing-requirements
name: Skip Missing Requirements
entry: echo "Skipping check for missing docs/requirements.txt"
language: system
files: ^docs/requirements\.txt$
]

0 comments on commit b563ea8

Please sign in to comment.