From 73d488acd2514357fac83ab1c9cc351a6499b1e1 Mon Sep 17 00:00:00 2001 From: "pre-commit-ci[bot]" <66853113+pre-commit-ci[bot]@users.noreply.github.com> Date: Tue, 12 Mar 2024 14:05:12 +0000 Subject: [PATCH] [pre-commit.ci] auto fixes from pre-commit.com hooks for more information, see https://pre-commit.ci --- .github/workflows/ci.yml | 3 +- .github/workflows/pr-linting.yml | 23 ++----------- .github/workflows/release-drafter.yml | 2 +- .gitpod.yml | 4 +-- .pre-commit-config.yaml | 17 ++++------ .vscode/extensions.json | 8 ++--- .vscode/settings.json | 30 +++++++++++++---- README.md | 1 - pyproject.toml | 47 +++++++++------------------ 9 files changed, 54 insertions(+), 81 deletions(-) diff --git a/.github/workflows/ci.yml b/.github/workflows/ci.yml index abcab48..1314fbc 100644 --- a/.github/workflows/ci.yml +++ b/.github/workflows/ci.yml @@ -2,7 +2,8 @@ name: CI concurrency: group: ${{ github.workflow }}-${{ github.ref }} - cancel-in-progress: true + cancel-in-progress: |- + ${{ github.ref != format('refs/heads/{0}', github.event.repository.default_branch) }} env: PYTHONHASHSEED: "0" diff --git a/.github/workflows/pr-linting.yml b/.github/workflows/pr-linting.yml index cd3bb74..0fab841 100644 --- a/.github/workflows/pr-linting.yml +++ b/.github/workflows/pr-linting.yml @@ -10,24 +10,5 @@ on: - unlabeled jobs: - check-labels: - name: Check labels - runs-on: ubuntu-22.04 - steps: - - uses: docker://agilepathway/pull-request-label-checker:latest # cspell:ignore agilepathway - with: - any_of: >- - 🐛 Bug,✨ Feature,⚙️ Enhancement,⚠️ Interface,❗ Behavior,📝 Docs,🔨 Maintenance,🖱️ DX - none_of: Epic,💫 Good first issue - repo_token: ${{ secrets.GITHUB_TOKEN }} - - check-title: - name: Check title - runs-on: ubuntu-22.04 - steps: - - uses: actions/checkout@v4 - - run: npm install @compwa/commitlint-config - - name: Create commitlint config - run: | - echo "module.exports = {extends: ['@compwa/commitlint-config']}" > commitlint.config.js - - uses: JulienKode/pull-request-name-linter-action@v0.5.0 # cspell:ignore kode + lint-pr: + uses: ComPWA/actions/.github/workflows/pr-linting.yml@v1 diff --git a/.github/workflows/release-drafter.yml b/.github/workflows/release-drafter.yml index d64f197..5234093 100644 --- a/.github/workflows/release-drafter.yml +++ b/.github/workflows/release-drafter.yml @@ -11,6 +11,6 @@ jobs: update_release_draft: runs-on: ubuntu-22.04 steps: - - uses: release-drafter/release-drafter@v5 + - uses: release-drafter/release-drafter@v6 env: GITHUB_TOKEN: ${{ secrets.GITHUB_TOKEN }} diff --git a/.gitpod.yml b/.gitpod.yml index 7894447..b36f8d9 100644 --- a/.gitpod.yml +++ b/.gitpod.yml @@ -22,13 +22,11 @@ vscode: - executablebookproject.myst-highlight - github.vscode-github-actions - github.vscode-pull-request-github - - ms-python.black-formatter - ms-python.python - ms-vscode.live-server - redhat.vscode-yaml - - Soulcode.vscode-unwanted-extensions + - soulcode.vscode-unwanted-extensions - stkb.rewrap - streetsidesoftware.code-spell-checker - tamasfe.even-better-toml - - tyriar.sort-lines - yzhang.markdown-all-in-one diff --git a/.pre-commit-config.yaml b/.pre-commit-config.yaml index e08b022..2680141 100644 --- a/.pre-commit-config.yaml +++ b/.pre-commit-config.yaml @@ -12,6 +12,12 @@ repos: - id: check-hooks-apply - id: check-useless-excludes + - repo: https://github.com/astral-sh/ruff-pre-commit + rev: v0.3.2 + hooks: + - id: ruff + args: [--fix] + - id: ruff-format - repo: https://github.com/pre-commit/pre-commit-hooks rev: v4.5.0 hooks: @@ -32,11 +38,6 @@ repos: - id: mixed-line-ending - id: trailing-whitespace - - repo: https://github.com/psf/black-pre-commit-mirror - rev: 24.2.0 - hooks: - - id: black - - repo: https://github.com/pre-commit/mirrors-prettier rev: v4.0.0-alpha.8 hooks: @@ -88,9 +89,3 @@ repos: hooks: - id: pyright - - repo: https://github.com/astral-sh/ruff-pre-commit - rev: v0.3.2 - hooks: - - id: ruff - args: - - --fix diff --git a/.vscode/extensions.json b/.vscode/extensions.json index f727ac4..1e91589 100644 --- a/.vscode/extensions.json +++ b/.vscode/extensions.json @@ -8,25 +8,25 @@ "executablebookproject.myst-highlight", "github.vscode-github-actions", "github.vscode-pull-request-github", - "ms-python.black-formatter", "ms-python.python", "ms-vscode.live-server", "redhat.vscode-yaml", - "Soulcode.vscode-unwanted-extensions", + "soulcode.vscode-unwanted-extensions", "stkb.rewrap", "streetsidesoftware.code-spell-checker", "tamasfe.even-better-toml", - "tyriar.sort-lines", "yzhang.markdown-all-in-one" ], "unwantedRecommendations": [ "bungcip.better-toml", "davidanson.vscode-markdownlint", "garaioag.garaio-vscode-unwanted-recommendations", + "ms-python.black-formatter", "ms-python.flake8", "ms-python.isort", "ms-python.mypy-type-checker", "ms-python.pylint", - "travisillig.vscode-json-stable-stringify" + "travisillig.vscode-json-stable-stringify", + "tyriar.sort-lines" ] } diff --git a/.vscode/settings.json b/.vscode/settings.json index a89a211..2cc7015 100644 --- a/.vscode/settings.json +++ b/.vscode/settings.json @@ -3,7 +3,9 @@ "editor.formatOnSave": false }, "[git-commit]": { - "editor.rulers": [72], + "editor.rulers": [ + 72 + ], "rewrap.wrappingColumn": 72 }, "[json]": { @@ -22,13 +24,14 @@ "editor.codeActionsOnSave": { "source.organizeImports": "explicit" }, - "editor.defaultFormatter": "ms-python.black-formatter", - "editor.rulers": [88] + "editor.defaultFormatter": "charliermarsh.ruff", + "editor.rulers": [ + 88 + ] }, "[yaml]": { "editor.defaultFormatter": "esbenp.prettier-vscode" }, - "black-formatter.importStrategy": "fromEnvironment", "cSpell.enabled": true, "diffEditor.experimental.showMoves": true, "editor.formatOnSave": true, @@ -39,17 +42,30 @@ "**/.tox/**": true }, "git.rebaseWhenSync": true, - "github-actions.workflows.pinned.workflows": [".github/workflows/ci.yml"], + "github-actions.workflows.pinned.workflows": [ + ".github/workflows/ci.yml" + ], + "gitlens.telemetry.enabled": false, "livePreview.defaultPreviewPath": "docs/_build/html", "multiDiffEditor.experimental.enabled": true, - "python.testing.pytestArgs": ["--color=no", "--no-cov"], + "notebook.codeActionsOnSave": { + "notebook.source.organizeImports": "explicit" + }, + "notebook.formatOnSave.enabled": true, + "python.testing.pytestArgs": [ + "--color=no", + "--no-cov" + ], "python.testing.pytestEnabled": false, "python.testing.unittestEnabled": false, + "redhat.telemetry.enabled": false, "rewrap.wrappingColumn": 88, "ruff.enable": true, + "ruff.importStrategy": "fromEnvironment", "ruff.organizeImports": true, "search.exclude": { "**/tests/**/__init__.py": true, "*/tox.ini": true - } + }, + "telemetry.telemetryLevel": "off" } diff --git a/README.md b/README.md index 9e4da31..c2a03cc 100644 --- a/README.md +++ b/README.md @@ -8,7 +8,6 @@ [![pre-commit.ci status](https://results.pre-commit.ci/badge/github/redeboer/bossdoc/main.svg)](https://results.pre-commit.ci/latest/github/redeboer/bossdoc/main) [![Spelling checked](https://img.shields.io/badge/cspell-checked-brightgreen.svg)](https://github.com/streetsidesoftware/cspell/tree/master/packages/cspell) [![code style: prettier](https://img.shields.io/badge/code_style-prettier-ff69b4.svg?style=flat-square)](https://github.com/prettier/prettier) -[![code style: black](https://img.shields.io/badge/code%20style-black-000000.svg)](https://github.com/psf/black) [![Ruff](https://img.shields.io/endpoint?url=https://raw.githubusercontent.com/charliermarsh/ruff/main/assets/badge/v2.json)](https://github.com/astral-sh/ruff) This repository contains the source code for the diff --git a/pyproject.toml b/pyproject.toml index 77b2c14..61a7cd5 100644 --- a/pyproject.toml +++ b/pyproject.toml @@ -62,9 +62,6 @@ doc = [ "sphinx-togglebutton", "sphinxcontrib-bibtex >=2", ] -format = [ - "black", -] lint = [ "ruff", "sphinx-api-relink", @@ -73,6 +70,7 @@ sty = [ "bossdoc[format]", "bossdoc[lint]", "pre-commit >=1.4.0", + "ruff", ] [project.readme] @@ -91,31 +89,6 @@ include-package-data = false [tool.setuptools_scm] write_to = "version.py" -[tool.black] -exclude = ''' -/( - .*\.egg-info - | .*build - | \.eggs - | \.git - | \.pytest_cache - | \.tox - | \.venv - | \.vscode - | dist -)/ -''' -include = '\.pyi?$' -preview = true -target-version = [ - "py310", - "py311", - "py312", - "py37", - "py38", - "py39", -] - [tool.pyright] exclude = [ ".git", @@ -143,6 +116,11 @@ typeCheckingMode = "strict" [tool.ruff] extend-exclude = ["typings"] +show-fixes = true +target-version = "py37" +preview = true + +[tool.ruff.lint] extend-select = [ "A", "B", @@ -186,14 +164,14 @@ ignore = [ "D407", "D416", "E501", + "ISC001", + "PLW1514", "SIM108", "UP036", ] -show-fixes = true -target-version = "py37" task-tags = ["cspell"] -[tool.ruff.per-file-ignores] +[tool.ruff.lint.per-file-ignores] "docs/*" = [ "E402", "INP001", @@ -209,9 +187,14 @@ task-tags = ["cspell"] ] "setup.py" = ["D100"] -[tool.ruff.pydocstyle] +[tool.ruff.lint.pydocstyle] convention = "google" +[tool.ruff.lint.isort] +split-on-trailing-comma = false +[tool.ruff.format] +docstring-code-format = true +line-ending = "lf" [tool.tomlsort] all = false ignore_case = true