diff --git a/.pre-commit-config.yaml b/.pre-commit-config.yaml deleted file mode 120000 index e3bc62d..0000000 --- a/.pre-commit-config.yaml +++ /dev/null @@ -1 +0,0 @@ -precommend/.pre-commit-config.yaml \ No newline at end of file diff --git a/.pre-commit-config.yaml b/.pre-commit-config.yaml new file mode 100644 index 0000000..d66935e --- /dev/null +++ b/.pre-commit-config.yaml @@ -0,0 +1,90 @@ +repos: + - repo: https://github.com/psf/black + rev: 24.2.0 + hooks: + # Run Black - the uncompromising Python code formatter + - id: black + # Run Black - the uncompromising Python code formatter (Jupyter version) + - id: black-jupyter + + - repo: https://github.com/pre-commit/pre-commit-hooks + rev: v4.5.0 + hooks: + # Ensure existence of newline characters at file ends + - id: end-of-file-fixer + # Make sure that contained YAML files are well-formed + - id: check-yaml + # Trim trailing whitespace of all sorts + - id: trailing-whitespace + # Apply a file size limit of 500kB + - id: check-added-large-files + # Simple parser validation of e.g. pyproject.toml + - id: check-toml + # Unify file endings + - id: end-of-file-fixer + # Sort lines in requirements files + - id: requirements-txt-fixer + # Check validity of JSON files + - id: check-json + # Format JSON files consistently + - id: pretty-format-json + exclude_types: + - jupyter + args: + - --autofix + # Ensure consistent line endings + - id: mixed-line-ending + + - repo: https://github.com/rhysd/actionlint + rev: v1.6.27 + hooks: + # GitHub Actions Workflow linter + - id: actionlint + + - repo: https://github.com/kynan/nbstripout + rev: 0.7.1 + hooks: + # Make sure that Jupyter notebooks under version control + # have their outputs stripped before committing + - id: nbstripout + files: ".ipynb" + + - repo: https://github.com/cheshirekow/cmake-format-precommit + rev: v0.6.13 + hooks: + # Apply formatting to CMake files + - id: cmake-format + # Apply linting to CMake files + - id: cmake-lint + + - repo: https://github.com/pre-commit/mirrors-clang-format + rev: v18.1.1 + hooks: + # Format C++ code with Clang-Format - automatically applying the changes + - id: clang-format + args: + - --style=Mozilla + + - repo: https://github.com/asottile/setup-cfg-fmt + rev: v2.5.0 + hooks: + # Automatically format/sanitize setup.cfg + - id: setup-cfg-fmt + + - repo: https://github.com/citation-file-format/cffconvert + rev: main + hooks: + # Validate CFF format + - id: validate-cff + + - repo: https://github.com/lovesegfault/beautysh + rev: v6.2.1 + hooks: + # Beautify Bash scripts + - id: beautysh + + - repo: https://github.com/abravalheri/validate-pyproject + rev: v0.16 + hooks: + # Validate the contents of pyproject.toml + - id: validate-pyproject