diff --git a/.github/workflows/pr-linting.yml b/.github/workflows/pr-linting.yml index 2dc8c43b..0396363c 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: @@ -16,7 +14,7 @@ jobs: name: Check labels runs-on: ubuntu-20.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,⚙️ Enhancement,⚠️ Interface,❗ Behavior,📝 Docs,🔨 Maintenance,🖱️ DX @@ -28,5 +26,8 @@ jobs: runs-on: ubuntu-20.04 steps: - uses: actions/checkout@v3 - - 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/.gitignore b/.gitignore index fb10abe8..28e9d586 100644 --- a/.gitignore +++ b/.gitignore @@ -10,6 +10,7 @@ *.xml *.yaml *.yml +commitlint.config.js # Build files *.egg-info/ diff --git a/.vscode/settings.json b/.vscode/settings.json index 0622e029..9a40f67b 100644 --- a/.vscode/settings.json +++ b/.vscode/settings.json @@ -62,8 +62,7 @@ "src/repoma/.template/.cspell.json": true, "src/repoma/.template/.gitpod.yml": true, "src/repoma/.template/.prettierrc": true, - "src/repoma/.template/.taplo.toml": true, - "src/repoma/.template/commitlint.config.js": true + "src/repoma/.template/.taplo.toml": true }, "yaml.schemas": { "https://citation-file-format.github.io/1.2.0/schema.json": "CITATION.cff", diff --git a/commitlint.config.js b/commitlint.config.js deleted file mode 100644 index d8b6bdcd..00000000 --- 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/src/repoma/check_dev_files/commitlint.py b/src/repoma/check_dev_files/commitlint.py index 8eacf0c3..7f19c138 100644 --- a/src/repoma/check_dev_files/commitlint.py +++ b/src/repoma/check_dev_files/commitlint.py @@ -1,6 +1,16 @@ -"""Check :file:`commitlint.config.js` config file.""" -from repoma.utilities import CONFIG_PATH, update_file +"""Remove :file:`commitlint.config.js` config file. + +See https://github.com/ComPWA/repo-maintenance/issues/177. +""" +import os + +from repoma.errors import PrecommitError def main() -> None: - update_file(CONFIG_PATH.commitlint, in_template_folder=True) + path = "commitlint.config.js" + if not os.path.exists(path): + return + os.remove(path) + msg = f"Remove outdated {path}" + raise PrecommitError(msg) diff --git a/src/repoma/utilities/__init__.py b/src/repoma/utilities/__init__.py index d766716d..170fc30e 100644 --- a/src/repoma/utilities/__init__.py +++ b/src/repoma/utilities/__init__.py @@ -14,7 +14,6 @@ class _ConfigFilePaths(NamedTuple): citation: Path = Path("CITATION.cff") codecov: Path = Path("codecov.yml") - commitlint: Path = Path("commitlint.config.js") cspell: Path = Path(".cspell.json") editorconfig: Path = Path(".editorconfig") github_workflow_dir: Path = Path(".github/workflows")