From 93f9f81407f9ae091b31f03a9485880d697bb2e8 Mon Sep 17 00:00:00 2001 From: Shyue Ping Ong Date: Mon, 24 Jul 2023 19:44:21 -0700 Subject: [PATCH] Add precommit. --- .pre-commit-config.yaml | 47 +++++++++++++++++++++++++++++++++++++++++ 1 file changed, 47 insertions(+) create mode 100644 .pre-commit-config.yaml diff --git a/.pre-commit-config.yaml b/.pre-commit-config.yaml new file mode 100644 index 0000000..a8ac071 --- /dev/null +++ b/.pre-commit-config.yaml @@ -0,0 +1,47 @@ +exclude: ^(docs|.*test_files|cmd_line|tasks.py) + +ci: + autoupdate_schedule: monthly + skip: [mypy] + autofix_commit_msg: pre-commit auto-fixes + autoupdate_commit_msg: pre-commit autoupdate + +repos: + - repo: https://github.com/astral-sh/ruff-pre-commit + rev: v0.0.278 + hooks: + - id: ruff + args: [--fix] + + - repo: https://github.com/pre-commit/pre-commit-hooks + rev: v4.4.0 + hooks: + - id: check-yaml + exclude: pymatgen/analysis/vesta_cutoffs.yaml + - id: end-of-file-fixer + - id: trailing-whitespace + + - repo: https://github.com/psf/black + rev: 23.7.0 + hooks: + - id: black + + - repo: https://github.com/pre-commit/mirrors-mypy + rev: v1.4.1 + hooks: + - id: mypy + + - repo: https://github.com/codespell-project/codespell + rev: v2.2.5 + hooks: + - id: codespell + stages: [commit, commit-msg] + exclude_types: [html] + additional_dependencies: [tomli] # needed to read pyproject.toml below py3.11 + + - repo: https://github.com/MarcoGorelli/cython-lint + rev: v0.15.0 + hooks: + - id: cython-lint + args: [--no-pycodestyle] + - id: double-quote-cython-strings