diff --git a/.cspell.json b/.cspell.json index fa1d406..5df0a82 100644 --- a/.cspell.json +++ b/.cspell.json @@ -23,7 +23,6 @@ ".github/dependabot.yml", ".gitignore", ".pre-commit-config.yaml", - ".taplo.toml", ".vscode/*", "pyproject.toml" ], diff --git a/.github/workflows/ci.yml b/.github/workflows/ci.yml new file mode 100644 index 0000000..1e0cdb1 --- /dev/null +++ b/.github/workflows/ci.yml @@ -0,0 +1,25 @@ +name: CI + +concurrency: + group: ${{ github.workflow }}-${{ github.ref }} + cancel-in-progress: |- + ${{ github.ref != format('refs/heads/{0}', github.event.repository.default_branch) }} + +on: + push: + branches: + - main + - epic/* + - "[0-9]+.[0-9]+.x" + pull_request: + branches: + - main + - epic/* + - "[0-9]+.[0-9]+.x" + workflow_dispatch: + +jobs: + style: + secrets: + token: ${{ secrets.PAT }} + uses: ComPWA/actions/.github/workflows/style.yml@v4.0 diff --git a/.pre-commit-config.yaml b/.pre-commit-config.yaml index 036b1bf..a11f16e 100644 --- a/.pre-commit-config.yaml +++ b/.pre-commit-config.yaml @@ -2,6 +2,9 @@ ci: autofix_commit_msg: "MAINT: implement pre-commit autofixes" autoupdate_commit_msg: "MAINT: upgrade lock files" autoupdate_schedule: quarterly + skip: + - tombi-format + - tombi-lint repos: - repo: meta @@ -10,16 +13,9 @@ repos: - id: check-useless-excludes - repo: https://github.com/ComPWA/policy - rev: 0.8.9 + rev: 0.9.0 hooks: - id: check-dev-files - args: - - --no-cd - - --keep-issue-templates - - --no-pypi - - --package-manager=none - - --repo-name=.github - - --repo-title=Public ComPWA GitHub profile - repo: https://github.com/pre-commit/pre-commit-hooks rev: v6.0.0 @@ -32,24 +28,20 @@ repos: - id: mixed-line-ending - id: trailing-whitespace + - repo: https://github.com/tombi-toml/tombi-pre-commit + rev: v1.2.0 + hooks: + - id: tombi-format + - id: tombi-lint + args: [--error-on-warnings] + - repo: https://github.com/ComPWA/prettier-pre-commit rev: v3.8.1 hooks: - id: prettier - - repo: https://github.com/ComPWA/taplo-pre-commit - rev: v0.9.3 - hooks: - - id: taplo-format - - - repo: https://github.com/pappasam/toml-sort - rev: v0.24.4 - hooks: - - id: toml-sort - args: [--in-place] - - repo: https://github.com/streetsidesoftware/cspell-cli - rev: v10.0.0 + rev: v10.0.1 hooks: - id: cspell language_version: 25.9.0 diff --git a/.python-version b/.python-version deleted file mode 100644 index e4fba21..0000000 --- a/.python-version +++ /dev/null @@ -1 +0,0 @@ -3.12 diff --git a/.taplo.toml b/.taplo.toml deleted file mode 100644 index 0db1df7..0000000 --- a/.taplo.toml +++ /dev/null @@ -1,12 +0,0 @@ -[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 443281a..082cde1 100644 --- a/.vscode/extensions.json +++ b/.vscode/extensions.json @@ -8,7 +8,7 @@ "soulcode.vscode-unwanted-extensions", "stkb.rewrap", "streetsidesoftware.code-spell-checker", - "tamasfe.even-better-toml" + "tombi-toml.tombi" ], "unwantedRecommendations": [ "bungcip.better-toml", @@ -17,6 +17,7 @@ "ms-python.flake8", "ms-python.isort", "ms-python.pylint", + "tamasfe.even-better-toml", "travisillig.vscode-json-stable-stringify", "tyriar.sort-lines" ] diff --git a/.vscode/settings.json b/.vscode/settings.json index f6fc0a7..6575ab3 100644 --- a/.vscode/settings.json +++ b/.vscode/settings.json @@ -6,6 +6,9 @@ "[json]": { "editor.wordWrap": "on" }, + "[toml]": { + "editor.defaultFormatter": "tombi-toml.tombi" + }, "diffEditor.experimental.showMoves": true, "editor.formatOnSave": true, "github-actions.workflows.pinned.workflows": [".github/workflows/ci.yml"], diff --git a/pyproject.toml b/pyproject.toml index 7cc1caa..7bce952 100644 --- a/pyproject.toml +++ b/pyproject.toml @@ -1,6 +1,41 @@ -[tool.tomlsort] -all = false -ignore_case = true -in_place = true -spaces_indent_inline_array = 4 -trailing_comma_inline_array = true +[tool.compwa.policy] +package-manager = "none" +repo-name = ".github" +repo-title = "Public ComPWA GitHub profile" + +[tool.compwa.policy.github] +no-cd = true +no-pypi = true + +[tool.compwa.policy.repo] +keep-issue-templates = true + +[tool.poe.tasks.all] +help = "Run all continuous integration (CI) tasks locally" +sequence = ["style"] + +[tool.poe.tasks.style] +cmd = "pre-commit run --all-files" +executor = { type = "simple" } +help = "Perform all linting, formatting, and spelling checks" + +[tool.poe.tasks.upgrade] +executor = { type = "simple" } +help = "Upgrade lock files" +parallel = ["_upgrade-precommit"] + +[tool.poe.tasks._upgrade-precommit] +cmd = "pre-commit autoupdate -j8" +executor = { type = "simple" } + +[tool.tombi.format.rules] +indent-width = 4 +line-width = 88 + +[tool.tombi.lint.rules] +key-empty = "off" + +[[tool.tombi.schemas]] +root = "tool.compwa.policy" +path = "https://raw.githubusercontent.com/ComPWA/policy/0.9.0/compwa-policy.schema.json" +include = ["pyproject.toml"]