Skip to content

Commit

Permalink
migrate to pre-commit v4
Browse files Browse the repository at this point in the history
  • Loading branch information
hofbi committed Nov 4, 2024
1 parent fd9ccca commit 282f860
Show file tree
Hide file tree
Showing 7 changed files with 42 additions and 26 deletions.
11 changes: 11 additions & 0 deletions .editorconfig
Original file line number Diff line number Diff line change
@@ -0,0 +1,11 @@
[*.sh]
indent_style = space
indent_size = 4

switch_case_indent = true

[.venv/**]
ignore = true

[.cache/**]
ignore = true
2 changes: 1 addition & 1 deletion .github/workflows/ci.yml
Original file line number Diff line number Diff line change
Expand Up @@ -114,7 +114,7 @@ jobs:
echo "# This branch is for deployment only" >> public/README.md
- name: Deploy Artifacts
if: github.ref == 'refs/heads/master'
uses: JamesIves/github-pages-deploy-action@v4.4.0
uses: JamesIves/github-pages-deploy-action@v4
with:
branch: gh-pages
folder: public
Expand Down
4 changes: 2 additions & 2 deletions .gitlab-ci.yml
Original file line number Diff line number Diff line change
Expand Up @@ -11,7 +11,7 @@ stages:

.python_setup: &python_setup
variables:
PIP_CACHE_DIR: "${CI_PROJECT_DIR}/.cache/pip"
UV_CACHE_DIR: "${CI_PROJECT_DIR}/.cache/uv"
PRE_COMMIT_HOME: "${CI_PROJECT_DIR}/.cache/pre-commit"
before_script:
- python -V
Expand All @@ -21,7 +21,7 @@ stages:
- uv pip install --upgrade -r requirements.txt
cache:
paths:
- .cache/pip
- .cache/uv
- .cache/pre-commit
- .venv/

Expand Down
39 changes: 22 additions & 17 deletions .pre-commit-config.yaml
Original file line number Diff line number Diff line change
@@ -1,4 +1,4 @@
default_stages: [commit]
default_stages: [pre-commit]

ci:
autoupdate_commit_msg: 'chore(deps): pre-commit.ci autoupdate'
Expand All @@ -11,7 +11,7 @@ repos:
- id: check-hooks-apply
- id: check-useless-excludes
- repo: https://github.com/pre-commit/pre-commit-hooks
rev: v4.6.0
rev: v5.0.0
hooks:
- id: check-added-large-files
- id: check-case-conflict
Expand Down Expand Up @@ -41,7 +41,7 @@ repos:
- id: requirements-txt-fixer
- id: trailing-whitespace
- repo: https://github.com/luminartech/dev-tools
rev: 0.1.0
rev: 0.4.0
hooks:
- id: check-snake-case
- id: check-cpp-and-cu-unit-test-naming-pattern
Expand All @@ -51,7 +51,7 @@ repos:
- id: check-shellscript-set-options
- id: check-non-existing-and-duplicate-excludes
- repo: https://github.com/executablebooks/mdformat
rev: 0.7.17
rev: 0.7.18
hooks:
- id: mdformat
exclude: ^slides/
Expand All @@ -68,7 +68,7 @@ repos:
args: ["--quiet", "--config", ".md-link-config.json"]
exclude: ^slides/homework
- repo: https://github.com/google/yamlfmt
rev: v0.13.0
rev: v0.14.0
hooks:
- id: yamlfmt
exclude: |
Expand All @@ -93,16 +93,17 @@ repos:
hooks:
- id: toml-sort-fix
- repo: https://github.com/PyCQA/docformatter
rev: v1.7.5
# Use tag > v1.7.5 if available
rev: eb1df347edd128b30cd3368dddc3aa65edcfac38
hooks:
- id: docformatter
additional_dependencies: [tomli]
- repo: https://github.com/pre-commit/mirrors-clang-format
rev: v18.1.8
rev: v19.1.3
hooks:
- id: clang-format
- repo: https://github.com/cpplint/cpplint
rev: 1.6.1
rev: 2.0.0
hooks:
- id: cpplint
- repo: https://github.com/cheshirekow/cmake-format-precommit
Expand All @@ -113,8 +114,8 @@ repos:
- id: cmake-lint
additional_dependencies: [cmakelang]
exclude: cmake/.*
- repo: https://github.com/astral-sh/ruff-pre-commit
rev: v0.6.3
- repo: https://github.com/charliermarsh/ruff-pre-commit
rev: v0.7.2
hooks:
- id: ruff
- id: ruff-format
Expand All @@ -127,32 +128,36 @@ repos:
- flake8-bugbear # Ruff does not implement all of bugbear
- flake8-requirements # Not yet implemented https://github.com/astral-sh/ruff/issues/4100
- repo: https://github.com/pre-commit/mirrors-mypy
rev: v1.11.2
rev: v1.13.0
hooks:
- id: mypy
args: [--python-version, '3.10']
args: [--python-version, '3.12']
- repo: https://github.com/PyCQA/pylint
rev: v3.2.7
rev: v3.3.1
hooks:
- id: pylint
- repo: https://github.com/asottile/pyupgrade
rev: v3.17.0
rev: v3.19.0
hooks:
- id: pyupgrade
args: [--py310-plus, --keep-runtime-typing]
args: [--py312-plus, --keep-runtime-typing]
- repo: https://github.com/MarcoGorelli/auto-walrus
rev: 0.3.4
hooks:
- id: auto-walrus
- repo: https://github.com/scop/pre-commit-shfmt
rev: v3.10.0-1
hooks:
- id: shfmt
- repo: https://github.com/shellcheck-py/shellcheck-py
rev: v0.10.0.1
hooks:
- id: shellcheck
- repo: https://github.com/python-jsonschema/check-jsonschema
rev: 0.29.2
rev: 0.29.4
hooks:
- id: check-github-workflows
- repo: https://github.com/crate-ci/typos
rev: typos-dict-v0.11.27
rev: v1.27.0
hooks:
- id: typos
2 changes: 1 addition & 1 deletion README.md
Original file line number Diff line number Diff line change
Expand Up @@ -95,7 +95,7 @@ We use [pre-commit](https://pre-commit.com/) to manage our git pre-commit hooks.
To set it up, call

```sh
git config --unset-all core.hooksPath # may fail if you don't have any hooks set, but that's ok
git config --unset-all core.hooksPath # may fail if you don't have any hooks set, but that's ok
pre-commit install --overwrite
```

Expand Down
2 changes: 1 addition & 1 deletion pyproject.toml
Original file line number Diff line number Diff line change
Expand Up @@ -54,7 +54,7 @@ disable = [

[tool.ruff]
fix = true
target-version = "py310"
target-version = "py312"
line-length = 120

[tool.ruff.lint]
Expand Down
8 changes: 4 additions & 4 deletions slides/docker-compose.yml
Original file line number Diff line number Diff line change
Expand Up @@ -4,16 +4,16 @@ services:
volumes:
- ./:/home/marp/app
environment:
- LANG=de_DE.UTF-8
- MARP_USER=""
LANG: de_DE.UTF-8
MARP_USER: ""
command: --input-dir ./lecture
serve:
image: marpteam/marp-cli
volumes:
- ./:/home/marp/app
environment:
- LANG=de_DE.UTF-8
- MARP_USER=""
LANG: de_DE.UTF-8
MARP_USER: ""
ports:
- 8080:8080
- 37717:37717
Expand Down

0 comments on commit 282f860

Please sign in to comment.