diff --git a/.cspell.json b/.cspell.json index d61eb4c..218dc0c 100644 --- a/.cspell.json +++ b/.cspell.json @@ -16,40 +16,17 @@ ], "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", - ".zenodo.json", "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" ], "language": "en-US", "words": ["ComPWA", "conda", "doctests", "pdgref", "pytest"], diff --git a/.github/ISSUE_TEMPLATE/bug_report.md b/.github/ISSUE_TEMPLATE/bug_report.md deleted file mode 100644 index d0cc61c..0000000 --- a/.github/ISSUE_TEMPLATE/bug_report.md +++ /dev/null @@ -1,32 +0,0 @@ ---- -name: Bug report -about: Create a report to help us improve -title: "" -labels: Bug -assignees: "" ---- - -## Bug description - - - - - -## How to reproduce? - -Steps to reproduce the behavior: - -1. - -## Expected behavior - - - -## System info - -Bug resulted on the following system: - -- OS: -- Version -- Python version: -- Virtual environment: diff --git a/.github/ISSUE_TEMPLATE/feature_request.md b/.github/ISSUE_TEMPLATE/feature_request.md deleted file mode 100644 index 049eb32..0000000 --- a/.github/ISSUE_TEMPLATE/feature_request.md +++ /dev/null @@ -1,22 +0,0 @@ ---- -name: Feature request -about: Suggest an idea for this project -title: "" -labels: "✨ Enhancement" -assignees: "" ---- - -## Problem description - - - -## Proposed solution - - - - - - - diff --git a/.github/pull_request_template.md b/.github/pull_request_template.md deleted file mode 100644 index 14b8085..0000000 --- a/.github/pull_request_template.md +++ /dev/null @@ -1,11 +0,0 @@ - - - - - diff --git a/.github/workflows/pr-linting.yml b/.github/workflows/pr-linting.yml index 6dff1a6..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 - 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@v3 - - name: Install Dependencies - run: npm install @commitlint/config-conventional - - uses: JulienKode/pull-request-name-linter-action@v0.1.2 + - 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 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/.gitignore b/.gitignore index 0e38618..03171f1 100644 --- a/.gitignore +++ b/.gitignore @@ -55,7 +55,6 @@ pyvenv*/ !.github/*.yml !.github/*/*.yml !.gitpod.yml -!.markdownlint.json !.pre-commit-config.yaml !.readthedocs.yml !.vscode/*.json diff --git a/.gitpod.yml b/.gitpod.yml index 2b60651..8b122f3 100644 --- a/.gitpod.yml +++ b/.gitpod.yml @@ -15,12 +15,12 @@ vscode: extensions: - charliermarsh.ruff - christian-kohler.path-intellisense - - davidanson.vscode-markdownlint - eamodio.gitlens - editorconfig.editorconfig - esbenp.prettier-vscode - garaioag.garaio-vscode-unwanted-recommendations - github.vscode-github-actions + - ms-python.black-formatter - ms-python.mypy-type-checker - ms-python.python - ms-python.vscode-pylance diff --git a/.markdownlint.json b/.markdownlint.json deleted file mode 100644 index 23bb7fa..0000000 --- a/.markdownlint.json +++ /dev/null @@ -1,7 +0,0 @@ -{ - "MD013": { "line_length": 88 }, - "MD026": { "punctuation": ".,;:。,;:!" }, - "MD033": { - "allowed_elements": ["br"] - } -} diff --git a/.pre-commit-config.yaml b/.pre-commit-config.yaml index 6fa8340..be64b24 100644 --- a/.pre-commit-config.yaml +++ b/.pre-commit-config.yaml @@ -13,7 +13,7 @@ repos: - id: check-useless-excludes - repo: https://github.com/pre-commit/pre-commit-hooks - rev: v4.4.0 + rev: v4.5.0 hooks: - id: check-ast - id: check-case-conflict @@ -41,26 +41,28 @@ repos: - id: trailing-whitespace - repo: https://github.com/ComPWA/repo-maintenance - rev: 0.0.192 + rev: 0.1.0 hooks: - id: check-dev-files args: + - --no-notebooks + - --no-prettierrc - --repo-name=sphinx-hep-pdgref - --repo-title=sphinx-hep-pdgref - id: format-setup-cfg - repo: https://github.com/psf/black - rev: 23.3.0 + rev: 23.9.1 hooks: - id: black - repo: https://github.com/asottile/blacken-docs - rev: 1.15.0 + rev: 1.16.0 hooks: - id: blacken-docs - repo: https://github.com/streetsidesoftware/cspell-cli - rev: v6.31.0 + rev: v7.3.1 hooks: - id: cspell @@ -85,30 +87,37 @@ repos: - python - repo: https://github.com/pre-commit/mirrors-prettier - rev: v3.0.0 + rev: v3.0.3 hooks: - id: prettier - repo: https://github.com/ComPWA/mirrors-pyright - rev: v1.1.316 + rev: v1.1.330 hooks: - id: pyright - repo: https://github.com/asottile/pyupgrade - rev: v3.9.0 + rev: v3.15.0 hooks: - id: pyupgrade args: - --py36-plus - repo: https://github.com/astral-sh/ruff-pre-commit - rev: v0.0.277 + rev: v0.0.292 hooks: - id: ruff args: - --fix - repo: https://github.com/ComPWA/mirrors-taplo - rev: v0.8.0 + 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/.prettierrc b/.prettierrc deleted file mode 100644 index ca09957..0000000 --- a/.prettierrc +++ /dev/null @@ -1 +0,0 @@ -printWidth: 88 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/extensions.json b/.vscode/extensions.json index d8a39b7..59f88b7 100644 --- a/.vscode/extensions.json +++ b/.vscode/extensions.json @@ -2,12 +2,12 @@ "recommendations": [ "charliermarsh.ruff", "christian-kohler.path-intellisense", - "davidanson.vscode-markdownlint", "eamodio.gitlens", "editorconfig.editorconfig", "esbenp.prettier-vscode", "garaioag.garaio-vscode-unwanted-recommendations", "github.vscode-github-actions", + "ms-python.black-formatter", "ms-python.mypy-type-checker", "ms-python.python", "ms-python.vscode-pylance", @@ -21,6 +21,7 @@ ], "unwantedRecommendations": [ "bungcip.better-toml", + "davidanson.vscode-markdownlint", "ms-python.flake8", "ms-python.isort", "ms-python.pylint", diff --git a/.vscode/settings.json b/.vscode/settings.json index 4168a87..484250c 100644 --- a/.vscode/settings.json +++ b/.vscode/settings.json @@ -2,6 +2,10 @@ "[bibtex]": { "editor.formatOnSave": false }, + "[git-commit]": { + "editor.rulers": [72], + "rewrap.wrappingColumn": 72 + }, "[json]": { "editor.defaultFormatter": "esbenp.prettier-vscode" }, @@ -9,8 +13,7 @@ "editor.defaultFormatter": "esbenp.prettier-vscode" }, "[markdown]": { - "editor.defaultFormatter": "esbenp.prettier-vscode", - "editor.wordWrap": "off" + "editor.defaultFormatter": "esbenp.prettier-vscode" }, "[pip-requirements]": { "editor.wordWrap": "off" @@ -18,18 +21,20 @@ "[python]": { "editor.codeActionsOnSave": { "source.organizeImports": true - } + }, + "editor.defaultFormatter": "ms-python.black-formatter", + "editor.rulers": [88] }, "[yaml]": { "editor.defaultFormatter": "esbenp.prettier-vscode" }, + "black-formatter.importStrategy": "fromEnvironment", "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], "files.watcherExclude": { "**/*_cache/**": true, "**/.eggs/**": true, @@ -39,19 +44,11 @@ "git.rebaseWhenSync": true, "github-actions.workflows.pinned.refresh.enabled": true, "github-actions.workflows.pinned.workflows": [".github/workflows/ci.yml"], - "mypy-type-checker.args": ["--config-file", "pyproject.toml"], + "mypy-type-checker.args": ["--config-file=${workspaceFolder}/pyproject.toml"], "mypy-type-checker.importStrategy": "fromEnvironment", "python.analysis.autoImportCompletions": false, "python.analysis.inlayHints.pytestParameters": true, "python.analysis.typeCheckingMode": "strict", - "python.formatting.provider": "black", - "python.linting.banditEnabled": false, - "python.linting.enabled": true, - "python.linting.flake8Enabled": false, - "python.linting.mypyEnabled": false, - "python.linting.pydocstyleEnabled": false, - "python.linting.pylamaEnabled": false, - "python.linting.pylintEnabled": false, "python.testing.pytestArgs": ["--color=no", "--no-cov"], "python.testing.pytestEnabled": true, "python.testing.unittestEnabled": false, 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 e157398..db91fa5 100644 --- a/pyproject.toml +++ b/pyproject.toml @@ -37,7 +37,6 @@ target-version = [ branch = true source = ["src"] - [tool.mypy] disallow_incomplete_defs = true disallow_untyped_defs = true @@ -149,6 +148,7 @@ ignore = [ "D416", "E501", "SIM108", + "UP036", ] show-fixes = true src = [ @@ -171,3 +171,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