From f8a6bf03ed4419a9a7801ee5f5bd52ee3e466a41 Mon Sep 17 00:00:00 2001 From: Tatiana Al-Chueyr Date: Tue, 19 May 2026 12:19:48 +0100 Subject: [PATCH 1/2] Require pre-commit to pass before committing and pushing CLAUDE.md already documented ``pre-commit run --all-files`` but did not state that it must pass before a commit lands or a PR is opened. Make the requirement explicit, including the docs style hooks (``scripts/check_docs_style.py``), since CI runs the same hooks and a local-skipped failure shows up as a noisy CI failure instead. Also rework the section slightly so the single-tool examples are framed as "if you need to iterate" rather than as an equivalent alternative to the full suite. Co-Authored-By: Claude Opus 4.7 (1M context) --- CLAUDE.md | 7 +++++-- 1 file changed, 5 insertions(+), 2 deletions(-) diff --git a/CLAUDE.md b/CLAUDE.md index c892437776..624a4a12a2 100644 --- a/CLAUDE.md +++ b/CLAUDE.md @@ -63,12 +63,15 @@ When writing or editing files under `docs/`, follow the Cosmos lightweight style ### Linting and Formatting -Pre-commit runs the configured linters/formatters (e.g., Black (formatter), Ruff (linter), mypy, codespell). See `.pre-commit-config.yaml` for the full list: +**Always run the full pre-commit suite locally and ensure it passes before committing or pushing.** This includes the formatters, linters, type checks, and style checks (`scripts/check_docs_style.py` for `docs/`, configured via `.pre-commit-config.yaml`). The same hooks run in CI; catching failures locally avoids a wasted CI round-trip and a noisy PR history: + ```bash pre-commit run --all-files ``` -Individual tools: +Pre-commit's configured tools (Black, Ruff, mypy, codespell, check_docs_style, etc.) are listed in `.pre-commit-config.yaml`. + +Individual tools, if you need to iterate on a single one: ```bash black --line-length 120 cosmos/ ruff check cosmos/ From 693c3d9cf55951009b354b453c00e2541b67353e Mon Sep 17 00:00:00 2001 From: Tatiana Al-Chueyr Date: Tue, 19 May 2026 12:25:45 +0100 Subject: [PATCH 2/2] Update CLAUDE.md Co-authored-by: Pankaj Koti --- CLAUDE.md | 2 +- 1 file changed, 1 insertion(+), 1 deletion(-) diff --git a/CLAUDE.md b/CLAUDE.md index 624a4a12a2..3960ff95c8 100644 --- a/CLAUDE.md +++ b/CLAUDE.md @@ -63,7 +63,7 @@ When writing or editing files under `docs/`, follow the Cosmos lightweight style ### Linting and Formatting -**Always run the full pre-commit suite locally and ensure it passes before committing or pushing.** This includes the formatters, linters, type checks, and style checks (`scripts/check_docs_style.py` for `docs/`, configured via `.pre-commit-config.yaml`). The same hooks run in CI; catching failures locally avoids a wasted CI round-trip and a noisy PR history: +**Always run the full pre-commit suite locally and ensure it passes before committing or pushing.** This includes the formatters, linters, type checks, and style checks (`scripts/check_docs_style.py` for `docs/`, configured via `.pre-commit-config.yaml`). The same hooks run in CI; catching failures locally avoids a wasted CI round-trip and a noisy PR history. ```bash pre-commit run --all-files