diff --git a/.pre-commit-config.yaml b/.pre-commit-config.yaml index caf7804..dbd9f8d 100644 --- a/.pre-commit-config.yaml +++ b/.pre-commit-config.yaml @@ -1,49 +1,52 @@ +exclude: | + (?x)^( + src/perm-mv0\.h$ | + src/kperm-gray\.h$ | + src/tables\.h$ | + src/swap\.h$ + ) + + repos: -- repo: https://github.com/pre-commit/pre-commit-hooks - rev: v4.5.0 - hooks: - - id: check-added-large-files # prevents giant files from being commit - - id: check-ast # Check whether files parse as valid python. - - id: check-case-conflict # Checks conflict case-insensitive - - id: check-executables-have-shebangs - - id: check-json - - id: check-merge-conflict - - id: check-symlinks # Check for symlinks which don't point - - id: check-toml - - id: check-vcs-permalinks - - id: debug-statements # Check for debugger imports and py37 breakpt - - id: detect-private-key # Checks for the existence of private keys. - - id: destroyed-symlinks - - id: end-of-file-fixer # Makes sure files end in a newline - - id: fix-byte-order-marker # Removes UTF-8 byte order marker - - id: mixed-line-ending # Replaces or checks mixed line ending. - - id: pretty-format-json # Checks JSON are pretty - args: ["--autofix", "--no-sort-keys"] - - id: trailing-whitespace # Trims trailing whitespace. -- repo: https://github.com/Lucas-C/pre-commit-hooks - rev: v1.5.4 - hooks: - - id: remove-crlf -- repo: https://github.com/psf/black - rev: 23.12.1 - hooks: - - id: black -- repo: https://github.com/astral-sh/ruff-pre-commit - rev: 'v0.1.9' - hooks: - - id: ruff -- repo: https://github.com/python-jsonschema/check-jsonschema - rev: 0.27.3 - hooks: - - id: check-github-workflows -- repo: https://github.com/pocc/pre-commit-hooks - rev: master - hooks: - - id: clang-format - args: [--style=Google] - - id: clang-tidy - - id: oclint - - id: uncrustify - - id: cppcheck - - id: cpplint - - id: include-what-you-use + - repo: https://github.com/pre-commit/pre-commit-hooks + rev: v4.5.0 + hooks: + - id: check-added-large-files # prevents giant files from being commit + - id: check-ast # Check whether files parse as valid python. + - id: check-case-conflict # Checks conflict case-insensitive + - id: check-executables-have-shebangs + - id: check-json + - id: check-merge-conflict + - id: check-symlinks # Check for symlinks which don't point + - id: check-toml + - id: check-vcs-permalinks + - id: debug-statements # Check for debugger imports and py37 breakpt + - id: detect-private-key # Checks for the existence of private keys. + - id: destroyed-symlinks + - id: end-of-file-fixer # Makes sure files end in a newline + - id: fix-byte-order-marker # Removes UTF-8 byte order marker + - id: mixed-line-ending # Replaces or checks mixed line ending. + - id: pretty-format-json # Checks JSON are pretty + args: ["--autofix", "--no-sort-keys"] + - id: trailing-whitespace # Trims trailing whitespace. + - repo: https://github.com/Lucas-C/pre-commit-hooks + rev: v1.5.5 + hooks: + - id: remove-crlf + - repo: https://github.com/psf/black + rev: 24.2.0 + hooks: + - id: black + - repo: https://github.com/astral-sh/ruff-pre-commit + rev: 'v0.3.2' + hooks: + - id: ruff + - repo: https://github.com/python-jsonschema/check-jsonschema + rev: 0.28.0 + hooks: + - id: check-github-workflows + - repo: https://github.com/pocc/pre-commit-hooks + rev: v1.3.5 + hooks: + - id: cppcheck # Perform static code analysis of the C/C++ files + args: [--suppress=missingIncludeSystem,--enable=all,--suppress=cstyleCast:src/py_permanent.cc,--suppress=unusedFunction:src/py_permanent.cc,"--suppress=*:src/perm-mv0.h","--suppress=*:src/kperm-gray.h","--suppress=*:src/tables.h","--suppress=*:src/swap.h","--suppress=*:src/permanent.h"] diff --git a/docs/requirements.txt b/docs/requirements.txt index a7649ab..8494cc0 100644 --- a/docs/requirements.txt +++ b/docs/requirements.txt @@ -2,3 +2,5 @@ numpy sphinx sphinx-rtd-theme sphinx-copybutton +pre-commit +cppcheck diff --git a/permanent/__init__.py b/permanent/__init__.py index 22da8dc..c0a21fd 100644 --- a/permanent/__init__.py +++ b/permanent/__init__.py @@ -1,6 +1,5 @@ r"""Module for computing the permanents of matrices.""" - __all__ = [ "opt", "combinatoric",