Skip to content

Commit

Permalink
extend pre-commit checks
Browse files Browse the repository at this point in the history
  • Loading branch information
orgua committed Mar 26, 2023
1 parent 045a1d5 commit 78482fa
Show file tree
Hide file tree
Showing 2 changed files with 82 additions and 10 deletions.
48 changes: 38 additions & 10 deletions .pre-commit-config.yaml
Original file line number Diff line number Diff line change
@@ -1,13 +1,7 @@
# install:
# pip3 install pre-commit
# sudo apt install cppcheck
# run:
# pre-commit run -a
# update deps:
# pre-commit autoupdate
# TODO:
# - auto-enable for repo on clone
# - more hooks (clang-format,...) https://pre-commit.com/hooks.html
# install pip3 install pre-commit
# sudo apt install cppcheck
# run pre-commit run -a
# update deps pre-commit autoupdate
repos:
- repo: https://github.com/pre-commit/pre-commit-hooks
rev: v4.4.0
Expand All @@ -31,6 +25,18 @@ repos:
hooks:
- id: add-trailing-comma

- repo: https://github.com/igorshubovych/markdownlint-cli
rev: v0.33.0
hooks:
- id: markdownlint
args: ["--disable", "MD013"] # ignore line length

- repo: https://github.com/abravalheri/validate-pyproject
rev: v0.12.1
hooks:
- id: validate-pyproject
args: ["./software/python-package/pyproject.toml"]

- repo: https://github.com/pycqa/isort
rev: 5.12.0
hooks:
Expand Down Expand Up @@ -127,6 +133,8 @@ repos:
- "--suppress=missingInclude"
- "--suppress=unmatchedSuppression"

########################## BETA SECTION #############################

# - id: clang-tidy
# args: [ "-checks=bugprone-,cert-,performance-,portability-"]
# TODO: add more c-linters, but there are to many false positives
Expand All @@ -139,5 +147,25 @@ repos:
# TODO: github.com/PyCQA/pydocstyle
# TODO: github.com/PyCQA/pylint

# - repo: https://github.com/RobertCraigie/pyright-python
# rev: v1.1.298
# hooks:
# - id: pyright
# additional_dependencies:
# - shepherd-herd
# - shepherd-sheep

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

# - repo: https://github.com/amperser/proselint
# rev: '0.13.0'
# hooks:
# - id: proselint
# args: ["docs/user/* docs/dev/* docs/projects/*"]

# default_language_version:
# python: python3.8
44 changes: 44 additions & 0 deletions setup.cfg
Original file line number Diff line number Diff line change
Expand Up @@ -78,3 +78,47 @@ exclude =

count = True
statistics = True

[ruff] # TODO: once stable it replaces flake8, pyupgrade, isort, ...
line-length = 100
select =
A
ARG
B
C
C4
E
ERA
F
# I # incomplete isort
N
PLC
PLE
PLR
PLW
RET
S
T10
UP
W # TODO: just a proposed starting-config

ignore = A003
target-version = py38

per-file-ignores =
__init__.py: F401
tests/**: ARG, S

# Unlike Flake8, default to a complexity level of 10.
mccabe =
max-complexity: 10

[pyright]
root = "./"
include =
./software/python-package
./software/shepherd-herd
./tests
pythonVersion = 3.8
pythonPlatform = All
reportMissingParameterType = True

0 comments on commit 78482fa

Please sign in to comment.