Skip to content

Commit

Permalink
Added pre-commit hooks for cpp code analysis
Browse files Browse the repository at this point in the history
  • Loading branch information
cassmasschelein committed Mar 11, 2024
1 parent e95e87e commit 8a35f8e
Show file tree
Hide file tree
Showing 3 changed files with 53 additions and 49 deletions.
99 changes: 51 additions & 48 deletions .pre-commit-config.yaml
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"]
2 changes: 2 additions & 0 deletions docs/requirements.txt
Original file line number Diff line number Diff line change
Expand Up @@ -2,3 +2,5 @@ numpy
sphinx
sphinx-rtd-theme
sphinx-copybutton
pre-commit
cppcheck
1 change: 0 additions & 1 deletion permanent/__init__.py
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",
Expand Down

0 comments on commit 8a35f8e

Please sign in to comment.