-
Notifications
You must be signed in to change notification settings - Fork 2
Commit
This commit does not belong to any branch on this repository, and may belong to a fork outside of the repository.
Added pre-commit hooks for cpp code analysis
- Loading branch information
1 parent
e95e87e
commit 8a35f8e
Showing
3 changed files
with
53 additions
and
49 deletions.
There are no files selected for viewing
This file contains bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
Original file line number | Diff line number | Diff line change |
---|---|---|
@@ -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"] |
This file contains bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
Original file line number | Diff line number | Diff line change |
---|---|---|
|
@@ -2,3 +2,5 @@ numpy | |
sphinx | ||
sphinx-rtd-theme | ||
sphinx-copybutton | ||
pre-commit | ||
cppcheck |
This file contains bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
Original file line number | Diff line number | Diff line change |
---|---|---|
@@ -1,6 +1,5 @@ | ||
r"""Module for computing the permanents of matrices.""" | ||
|
||
|
||
__all__ = [ | ||
"opt", | ||
"combinatoric", | ||
|