diff --git a/.github/workflows/CI.yaml b/.github/workflows/CI.yaml index be8859c..b9953d7 100644 --- a/.github/workflows/CI.yaml +++ b/.github/workflows/CI.yaml @@ -22,6 +22,19 @@ concurrency: cancel-in-progress: true jobs: + lint: + runs-on: ubuntu-latest + steps: + - uses: actions/checkout@v4 + + - uses: actions/setup-python@v5 + with: + python-version: "3.9" + cache: pip + cache-dependency-path: pyproject.toml + + - uses: pre-commit/action@v3.0.0 + test: name: Test on ${{ matrix.os }}, Python ${{ matrix.python-version }} runs-on: ${{ matrix.os }} diff --git a/.pre-commit-config.yaml b/.pre-commit-config.yaml new file mode 100644 index 0000000..44eea0b --- /dev/null +++ b/.pre-commit-config.yaml @@ -0,0 +1,46 @@ +default_language_version: + python: python3 +exclude: ^(.github/|tests/test_data/abinit/) +repos: +- repo: https://github.com/charliermarsh/ruff-pre-commit + rev: v0.4.2 + hooks: + - id: ruff + args: [--fix] + - id: ruff-format +- repo: https://github.com/pre-commit/pre-commit-hooks + rev: v4.6.0 + hooks: + - id: check-yaml + - id: fix-encoding-pragma + args: [--remove] + - id: end-of-file-fixer + - id: trailing-whitespace +- repo: https://github.com/asottile/blacken-docs + rev: 1.16.0 + hooks: + - id: blacken-docs + additional_dependencies: [black] + exclude: README.md +- repo: https://github.com/pre-commit/pygrep-hooks + rev: v1.10.0 + hooks: + - id: python-use-type-annotations + - id: rst-backticks + - id: rst-directive-colons + - id: rst-inline-touching-normal +- repo: https://github.com/pre-commit/mirrors-mypy + rev: v1.10.0 + hooks: + - id: mypy + files: ^src/ + additional_dependencies: + - tokenize-rt==4.1.0 + - types-paramiko +- repo: https://github.com/codespell-project/codespell + rev: v2.2.6 + hooks: + - id: codespell + stages: [commit, commit-msg] + args: [--ignore-words-list, 'titel,statics,ba,nd,te,atomate'] + types_or: [python, rst, markdown]