diff --git a/.github/workflows/lint.yml b/.github/workflows/lint.yml index 88c0c7c..d553e49 100644 --- a/.github/workflows/lint.yml +++ b/.github/workflows/lint.yml @@ -4,6 +4,7 @@ on: [push, pull_request, workflow_dispatch] env: FORCE_COLOR: 1 + PIP_DISABLE_PIP_VERSION_CHECK: 1 permissions: contents: read @@ -17,4 +18,5 @@ jobs: - uses: actions/setup-python@v5 with: python-version: "3.x" + cache: pip - uses: pre-commit/action@v3.0.1 diff --git a/.github/workflows/test.yml b/.github/workflows/test.yml index 7381cfa..f8201fa 100644 --- a/.github/workflows/test.yml +++ b/.github/workflows/test.yml @@ -2,8 +2,12 @@ name: Test on: [push, pull_request, workflow_dispatch] +permissions: + contents: read + env: FORCE_COLOR: 1 + PIP_DISABLE_PIP_VERSION_CHECK: 1 jobs: test: @@ -27,7 +31,6 @@ jobs: - name: Install dependencies run: | python -m pip install -U pip - python -m pip install -U wheel python -m pip install -U tox - name: Tox tests @@ -38,7 +41,7 @@ jobs: uses: codecov/codecov-action@v3.1.5 with: flags: ${{ matrix.os }} - name: ${{ matrix.os }} Python ${{ matrix.python-version }} + name: "${{ matrix.os }} Python ${{ matrix.python-version }}" success: needs: test diff --git a/.pre-commit-config.yaml b/.pre-commit-config.yaml index 424148a..abb4806 100644 --- a/.pre-commit-config.yaml +++ b/.pre-commit-config.yaml @@ -1,19 +1,20 @@ repos: - repo: https://github.com/astral-sh/ruff-pre-commit - rev: v0.3.5 + rev: v0.4.5 hooks: - id: ruff - args: [--fix, --exit-non-zero-on-fix] + args: [--exit-non-zero-on-fix] - repo: https://github.com/psf/black-pre-commit-mirror - rev: 24.3.0 + rev: 24.4.2 hooks: - id: black exclude: ^html/ - repo: https://github.com/pre-commit/pre-commit-hooks - rev: v4.5.0 + rev: v4.6.0 hooks: + - id: check-added-large-files - id: check-case-conflict - id: check-merge-conflict - id: check-json @@ -21,16 +22,28 @@ repos: - id: check-yaml - id: debug-statements - id: end-of-file-fixer + - id: forbid-submodules - id: trailing-whitespace + - repo: https://github.com/python-jsonschema/check-jsonschema + rev: 0.28.4 + hooks: + - id: check-github-workflows + - id: check-renovate + + - repo: https://github.com/rhysd/actionlint + rev: v1.7.0 + hooks: + - id: actionlint + - repo: https://github.com/tox-dev/pyproject-fmt - rev: 1.7.0 + rev: 1.8.0 hooks: - id: pyproject-fmt additional_dependencies: [tox] - repo: https://github.com/abravalheri/validate-pyproject - rev: v0.16 + rev: v0.18 hooks: - id: validate-pyproject diff --git a/pyproject.toml b/pyproject.toml index adaa1cf..733587b 100644 --- a/pyproject.toml +++ b/pyproject.toml @@ -52,6 +52,9 @@ version.source = "vcs" [tool.hatch.version.raw-options] local_scheme = "no-local-version" +[tool.ruff] +fix = true + [tool.ruff.lint] select = [ "C4", # flake8-comprehensions @@ -63,6 +66,7 @@ select = [ "LOG", # flake8-logging "PGH", # pygrep-hooks "RUF100", # unused noqa (yesqa) + "RUF022", # unsorted-dunder-all "UP", # pyupgrade "W", # pycodestyle warnings "YTT", # flake8-2020