From 7430d18c8e21d93be8291e42ee8df7078799ee52 Mon Sep 17 00:00:00 2001 From: shenxianpeng Date: Tue, 4 Aug 2026 05:25:23 +0000 Subject: [PATCH] docs: update documentation links to commit-check.com The documentation moved to its own repository and is served from the apex domain alongside the landing page and the blog. RULES_DOCS_URL matters most here: it is embedded in every failure message the tool prints, so it has to be correct before the next release makes it permanent. A test now pins the base URL rather than deriving expectations from it, so a wrong or reverted value fails instead of being followed. The CLI reference page is gone, and the flags it listed are documented alongside the settings that control them, so those links now point at the configuration page. --- .gitignore | 3 +++ README.md | 8 ++++---- commit_check/rules_catalog.py | 2 +- pyproject.toml | 2 +- tests/rules_catalog_test.py | 12 ++++++++++++ 5 files changed, 21 insertions(+), 6 deletions(-) diff --git a/.gitignore b/.gitignore index 546ac132..d881b6ae 100644 --- a/.gitignore +++ b/.gitignore @@ -23,3 +23,6 @@ docs/__pycache__ # MkDocs site/ docs/cli.md + +# Social card cache written by the docs build +.cache/ diff --git a/README.md b/README.md index 919e5f2d..c9a2a026 100644 --- a/README.md +++ b/README.md @@ -88,7 +88,7 @@ pip install git+https://github.com/commit-check/commit-check.git@main ``` Then, run `commit-check --help` or `cchk --help` (alias for `commit-check`) from the command line. -For more information, see the [docs](https://docs.commit-check.com/cli_args.html). +For more information, see the [docs](https://commit-check.com/configuration/). ## Configuration @@ -209,7 +209,7 @@ repos: - --author-email-pattern=^.+@example\.com$ ``` -See the [Configuration documentation](https://docs.commit-check.com/configuration.html) for all available options. +See the [Configuration documentation](https://commit-check.com/configuration/) for all available options. ### Check Push Safety @@ -377,7 +377,7 @@ Available API functions: - `validate_author(name=None, email=None, *, config=None)` — validate author name/email - `validate_all(message, branch, author_name, author_email, *, config=None)` — run all checks at once -For detailed usage instructions including pre-commit hooks, CLI commands, and STDIN examples, see the [Usage Examples documentation](https://docs.commit-check.com/example.html). +For detailed usage instructions including pre-commit hooks, CLI commands, and STDIN examples, see the [Usage Examples documentation](https://commit-check.com/example/). ## Examples @@ -423,7 +423,7 @@ The branch should follow Conventional Branch. See https://conventionalbranch.org Suggest: Use / with allowed types or add branch name to allow_branch_names in config, or use ignore_authors in config branch section to bypass ``` -More examples see [example documentation](https://docs.commit-check.com/example.html). +For more examples, see the [example documentation](https://commit-check.com/example/). ## Badging your repository diff --git a/commit_check/rules_catalog.py b/commit_check/rules_catalog.py index a912cc1c..7651a18f 100644 --- a/commit_check/rules_catalog.py +++ b/commit_check/rules_catalog.py @@ -21,7 +21,7 @@ from dataclasses import dataclass #: Base URL of the rules reference documentation. -RULES_DOCS_URL = "https://docs.commit-check.com/rules/" +RULES_DOCS_URL = "https://commit-check.com/rules/" @dataclass(frozen=True) diff --git a/pyproject.toml b/pyproject.toml index 8a0a62eb..889ab4da 100644 --- a/pyproject.toml +++ b/pyproject.toml @@ -38,7 +38,7 @@ commit-check = "commit_check.main:main" cchk = "commit_check.main:main" # short alias without clobbering system cc [project.urls] -documentation = "https://docs.commit-check.com/" +documentation = "https://commit-check.com/" source = "https://github.com/commit-check/commit-check" tracker = "https://github.com/commit-check/commit-check/issues" diff --git a/tests/rules_catalog_test.py b/tests/rules_catalog_test.py index e8c330be..7cf8f9c1 100644 --- a/tests/rules_catalog_test.py +++ b/tests/rules_catalog_test.py @@ -65,6 +65,18 @@ def test_docs_url_derives_from_id(self): entry = RuleCatalogEntry(check="subject_imperative", rule_id="CC003") assert entry.docs_url == f"{RULES_DOCS_URL}#cc003" + @pytest.mark.benchmark + def test_docs_url_points_at_the_published_site(self): + """The base URL is pinned, not just derived. + + Every failure the tool reports carries this URL, and released versions + keep printing whatever they shipped with, so a wrong value cannot be + corrected after the fact. The other tests build their expectations from + ``RULES_DOCS_URL`` and would follow it anywhere, including back to a + host that no longer serves the documentation. + """ + assert RULES_DOCS_URL == "https://commit-check.com/rules/" + @pytest.mark.benchmark def test_no_docs_url_without_id(self): """An entry without a rule ID has no docs URL to link to."""