From 05ab0f2ad6699a44c50600199207e592d0876947 Mon Sep 17 00:00:00 2001 From: Remco de Boer <29308176+redeboer@users.noreply.github.com> Date: Mon, 9 Oct 2023 16:44:04 +0200 Subject: [PATCH] DX: synchronize ComPWA developer setup --- .cspell.json | 22 +--------------------- .github/workflows/pr-linting.yml | 21 +++++++++++---------- .github/workflows/release-drafter.yml | 2 +- .pre-commit-config.yaml | 9 ++++++++- .taplo.toml | 10 +++------- .vscode/settings.json | 10 ++++++---- commitlint.config.js | 11 ----------- pyproject.toml | 17 +++++++++++++++-- 8 files changed, 45 insertions(+), 57 deletions(-) delete mode 100644 commitlint.config.js diff --git a/.cspell.json b/.cspell.json index ed7a4b8..84dc62c 100644 --- a/.cspell.json +++ b/.cspell.json @@ -14,40 +14,20 @@ ], "ignorePaths": [ "**/.cspell.json", - "*.bib", - "*.ico", - "*.root", - "*.rst_t", - "*.svg", - "*particle*.*ml", ".constraints/*.txt", ".editorconfig", ".gitignore", ".gitpod.*", - ".mypy.ini", ".pre-commit-config.yaml", ".prettierignore", - ".readthedocs.yml", ".vscode/*", - ".vscode/.gitignore", - "CITATION.cff", "codecov.yml", - "Dockerfile", "docs/_templates/*", - "docs/adr/*/*", "docs/conf.py", - "labels.toml", - "Makefile", - "Manifest.toml", - "Project.toml", "pyproject.toml", - "pyrightconfig.json", - "pytest.ini", - "requirements*.txt", "setup.cfg", "setup.py", - "tox.ini", - "typings" + "tox.ini" ], "ignoreWords": [ "MAINT", diff --git a/.github/workflows/pr-linting.yml b/.github/workflows/pr-linting.yml index 42cd7f8..cd3bb74 100644 --- a/.github/workflows/pr-linting.yml +++ b/.github/workflows/pr-linting.yml @@ -1,5 +1,3 @@ -# cspell:ignore agilepathway commitlint kode - name: PR linting on: pull_request: @@ -14,19 +12,22 @@ on: jobs: check-labels: name: Check labels - runs-on: ubuntu-20.04 + runs-on: ubuntu-22.04 steps: - - uses: docker://agilepathway/pull-request-label-checker:latest + - uses: docker://agilepathway/pull-request-label-checker:latest # cspell:ignore agilepathway with: - any_of: Bug,✨ Feature,⚠️ Interface,📝 Docs,🔨 Maintenance,🖱️ DX,📖 Physics - none_of: Epic,❌ Won't fix,💫 Good first issue + 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-20.04 + runs-on: ubuntu-22.04 steps: - uses: actions/checkout@v4 - - name: Install Dependencies - run: npm install @commitlint/config-conventional - - uses: JulienKode/pull-request-name-linter-action@v0.5.0 + - 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 diff --git a/.github/workflows/release-drafter.yml b/.github/workflows/release-drafter.yml index d54187d..d64f197 100644 --- a/.github/workflows/release-drafter.yml +++ b/.github/workflows/release-drafter.yml @@ -9,7 +9,7 @@ on: jobs: update_release_draft: - runs-on: ubuntu-20.04 + runs-on: ubuntu-22.04 steps: - uses: release-drafter/release-drafter@v5 env: diff --git a/.pre-commit-config.yaml b/.pre-commit-config.yaml index 9cd74de..4d2e1c8 100644 --- a/.pre-commit-config.yaml +++ b/.pre-commit-config.yaml @@ -31,7 +31,7 @@ repos: - id: trailing-whitespace - repo: https://github.com/ComPWA/repo-maintenance - rev: 0.1.0rc5 + rev: 0.1.0rc6 hooks: - id: check-dev-files args: @@ -129,3 +129,10 @@ repos: rev: v0.8.1 hooks: - id: taplo + + - repo: https://github.com/pappasam/toml-sort + rev: v0.23.1 + hooks: + - id: toml-sort + args: + - --in-place diff --git a/.taplo.toml b/.taplo.toml index f5caabe..0db1df7 100644 --- a/.taplo.toml +++ b/.taplo.toml @@ -1,16 +1,12 @@ -exclude = [ - "**/Cargo.toml", - "**/Manifest.toml", - "**/Project.toml", - "labels*.toml", -] - [formatting] +align_comments = false align_entries = false +allowed_blank_lines = 1 array_auto_collapse = false array_auto_expand = true array_trailing_comma = true column_width = 88 +compact_inline_tables = true indent_string = " " reorder_arrays = true reorder_keys = true diff --git a/.vscode/settings.json b/.vscode/settings.json index 5518fe3..ab5ab0e 100644 --- a/.vscode/settings.json +++ b/.vscode/settings.json @@ -1,5 +1,6 @@ { "[git-commit]": { + "editor.rulers": [72], "rewrap.wrappingColumn": 72 }, "[ipynb]": { @@ -19,25 +20,26 @@ "editor.codeActionsOnSave": { "source.organizeImports": true }, - "editor.defaultFormatter": "ms-python.black-formatter" + "editor.defaultFormatter": "ms-python.black-formatter", + "editor.rulers": [88] }, "[yaml]": { "editor.defaultFormatter": "esbenp.prettier-vscode" }, "black-formatter.importStrategy": "fromEnvironment", - "cSpell.enabled": true, "coverage-gutters.coverageFileNames": ["coverage.xml"], "coverage-gutters.coverageReportFileName": "**/htmlcov/index.html", "coverage-gutters.showGutterCoverage": false, "coverage-gutters.showLineCoverage": true, + "cSpell.enabled": true, "editor.formatOnSave": true, - "editor.rulers": [88], "git.rebaseWhenSync": true, "github-actions.workflows.pinned.workflows": [".github/workflows/ci.yml"], "gitlens.telemetry.enabled": false, "livePreview.defaultPreviewPath": "docs/_build/html", - "mypy-type-checker.args": ["--config-file", "pyproject.toml"], + "mypy-type-checker.args": ["--config-file=${workspaceFolder}/pyproject.toml"], "mypy-type-checker.importStrategy": "fromEnvironment", + "notebook.gotoSymbols.showAllSymbols": true, "python.analysis.autoImportCompletions": false, "python.analysis.inlayHints.pytestParameters": true, "python.analysis.typeCheckingMode": "strict", diff --git a/commitlint.config.js b/commitlint.config.js deleted file mode 100644 index d8b6bdc..0000000 --- a/commitlint.config.js +++ /dev/null @@ -1,11 +0,0 @@ -module.exports = { - extends: ["@commitlint/config-conventional"], - rules: { - "type-case": [2, "always", ["upper-case"]], - "type-enum": [ - 2, - "always", - ["BEHAVIOR", "BREAK", "DOC", "DX", "ENH", "FEAT", "FIX", "MAINT"], - ], - }, -}; diff --git a/pyproject.toml b/pyproject.toml index 7c9f6d2..da70be0 100644 --- a/pyproject.toml +++ b/pyproject.toml @@ -37,8 +37,6 @@ target-version = [ branch = true source = ["src"] -[tool.nbqa.addopts] - [tool.mypy] disallow_incomplete_defs = true disallow_untyped_defs = true @@ -167,6 +165,7 @@ ignore = [ "D416", "E501", "SIM108", + "UP036", ] show-fixes = true src = [ @@ -200,3 +199,17 @@ task-tags = ["cspell"] [tool.ruff.pydocstyle] convention = "google" + +[tool.tomlsort] +all = false +ignore_case = true +in_place = true +sort_first = [ + "build-system", + "project", + "tool.setuptools", + "tool.setuptools_scm", +] +sort_table_keys = true +spaces_indent_inline_array = 4 +trailing_comma_inline_array = true