update-policy: also fetch the style guides for the repo's languages (closes #182) #183

Open
clawbot wants to merge 1 commits from issue-182-language-style-guides into next
pull from: issue-182-language-style-guides
Collaborator

Closes #182

script/update-policy now also fetches the style guides for the repo's own languages into docs/:

  • go.mod at the root: CODE_STYLEGUIDE_GO.md, plus GO_HTTP_SERVER_CONVENTIONS.md when a tracked .go file imports net/http
  • tracked .js or .ts files: CODE_STYLEGUIDE_JS.md
  • pyproject.toml or setup.py at the root: CODE_STYLEGUIDE_PYTHON.md

The list in REPO_POLICIES.md names the new files. Tests cover Go with and without net/http, a Go repo whose package.json only pins prettier, JS plus Python together, and no language files.

Things the diff does not show:

  • JavaScript is not detected by package.json: many Go repos carry one only to pin prettier. The tracked yarn release in .yarn/releases/ is a .cjs file, so it does not count.
  • Judgement call: the net/http search includes _test.go files, as the issue says "any .go file". A repo that uses net/http only in tests still gets the HTTP conventions. In a fresh clone of vaultik that is what happened, through internal/s3/s3_test.go. Leaving test files out would take one more pathspec.
  • Only tracked files are searched (git grep, git ls-files), so a file that is not yet committed does not count.
  • The script fetches from main, which does not carry script/update-policy yet. My trial run in vaultik therefore fetched from next.
  • A guide the repo no longer needs is not deleted.

Model: opus-5-5

Closes https://git.eeqj.de/sneak/prompts/issues/182 `script/update-policy` now also fetches the style guides for the repo's own languages into `docs/`: - `go.mod` at the root: `CODE_STYLEGUIDE_GO.md`, plus `GO_HTTP_SERVER_CONVENTIONS.md` when a tracked `.go` file imports `net/http` - tracked `.js` or `.ts` files: `CODE_STYLEGUIDE_JS.md` - `pyproject.toml` or `setup.py` at the root: `CODE_STYLEGUIDE_PYTHON.md` The list in `REPO_POLICIES.md` names the new files. Tests cover Go with and without `net/http`, a Go repo whose `package.json` only pins prettier, JS plus Python together, and no language files. Things the diff does not show: - JavaScript is not detected by `package.json`: many Go repos carry one only to pin prettier. The tracked yarn release in `.yarn/releases/` is a `.cjs` file, so it does not count. - Judgement call: the `net/http` search includes `_test.go` files, as the issue says "any `.go` file". A repo that uses `net/http` only in tests still gets the HTTP conventions. In a fresh clone of `vaultik` that is what happened, through `internal/s3/s3_test.go`. Leaving test files out would take one more pathspec. - Only tracked files are searched (`git grep`, `git ls-files`), so a file that is not yet committed does not count. - The script fetches from `main`, which does not carry `script/update-policy` yet. My trial run in `vaultik` therefore fetched from `next`. - A guide the repo no longer needs is not deleted. Model: opus-5-5
clawbot added the needs-review label 2026-11-19 03:57:09 +01:00
clawbot self-assigned this 2026-11-19 03:57:09 +01:00
Author
Collaborator

Verdict: FAIL
Head: 9862d2b52a

  1. script/update-policy, language_files: a root package.json does not mean a repo has JavaScript. Most of sneak's Go repos carry one only to pin prettier for their markdown: vaultik, pixa and dnswatcher do, and template-app-go's says "Not a JavaScript project". A run in any of them commits docs/CODE_STYLEGUIDE_JS.md, which breaks the definition of done in #182 ("no other language's guide"). Acceptable:
    • fetch the JS guide when the repo tracks .js or .ts files (git ls-files -- '*.js' '*.ts' is not empty); the tracked yarn release in .yarn/releases/ is a .cjs file, so it does not count;
    • change the docs/CODE_STYLEGUIDE_JS.md bullet in prompts/REPO_POLICIES.md and the comment above language_files to match;
    • add a test where a Go repo with a prettier-only package.json gets no JS guide, and give the JS-and-Python test a tracked .js file.

Judgement call: the issue's marker list names package.json, and its definition of done excludes other languages' guides. Where the two conflict, this review follows the definition of done.

Model: opus-5-5

Verdict: FAIL Head: 9862d2b52abaf05b6fb986d058dbba672067894c 1. `script/update-policy`, `language_files`: a root `package.json` does not mean a repo has JavaScript. Most of sneak's Go repos carry one only to pin prettier for their markdown: `vaultik`, `pixa` and `dnswatcher` do, and `template-app-go`'s says "Not a JavaScript project". A run in any of them commits `docs/CODE_STYLEGUIDE_JS.md`, which breaks the definition of done in https://git.eeqj.de/sneak/prompts/issues/182 ("no other language's guide"). Acceptable: - fetch the JS guide when the repo tracks `.js` or `.ts` files (`git ls-files -- '*.js' '*.ts'` is not empty); the tracked yarn release in `.yarn/releases/` is a `.cjs` file, so it does not count; - change the `docs/CODE_STYLEGUIDE_JS.md` bullet in `prompts/REPO_POLICIES.md` and the comment above `language_files` to match; - add a test where a Go repo with a prettier-only `package.json` gets no JS guide, and give the JS-and-Python test a tracked `.js` file. Judgement call: the issue's marker list names `package.json`, and its definition of done excludes other languages' guides. Where the two conflict, this review follows the definition of done. Model: opus-5-5
Author
Collaborator

For the reworker: do exactly what the review above lists as acceptable. Detect JavaScript by tracked .js or .ts files (git ls-files -- '*.js' '*.ts' not empty), not by package.json; update the REPO_POLICIES.md bullet and the comment to match; add the Go-repo-with-prettier-only-package.json test and give the JS-and-Python test a tracked .js file. Change nothing else. The package.json marker in my spec on issue 182 was wrong.

Model: opus-5-5

For the reworker: do exactly what the review above lists as acceptable. Detect JavaScript by tracked `.js` or `.ts` files (`git ls-files -- '*.js' '*.ts'` not empty), not by `package.json`; update the `REPO_POLICIES.md` bullet and the comment to match; add the Go-repo-with-prettier-only-`package.json` test and give the JS-and-Python test a tracked `.js` file. Change nothing else. The `package.json` marker in my spec on issue 182 was wrong. Model: opus-5-5
clawbot added 1 commit 2026-11-19 04:25:22 +01:00
A go.mod adds the Go guide, plus the Go HTTP server conventions when a
tracked .go file imports net/http. Tracked .js or .ts files add the JS
guide; a pyproject.toml or setup.py adds the Python guide. Each goes to
docs/.

Model: opus-5-5
clawbot force-pushed issue-182-language-style-guides from 9862d2b52a to 87ccb3e7e3 2026-11-19 04:25:22 +01:00 Compare
Author
Collaborator

Rework of head 87ccb3e, on current next:

  • JavaScript is now detected by tracked .js or .ts files (git ls-files -- '*.js' '*.ts'), not package.json.
  • REPO_POLICIES.md bullet and the comment above language_files changed to match.
  • Added the test: a Go repo with a prettier-only package.json and a tracked .yarn/releases/*.cjs gets no JS guide; the JS-and-Python test now tracks an index.js.

Model: opus-5-5

Rework of head `87ccb3e`, on current `next`: - JavaScript is now detected by tracked `.js` or `.ts` files (`git ls-files -- '*.js' '*.ts'`), not `package.json`. - `REPO_POLICIES.md` bullet and the comment above `language_files` changed to match. - Added the test: a Go repo with a prettier-only `package.json` and a tracked `.yarn/releases/*.cjs` gets no JS guide; the JS-and-Python test now tracks an `index.js`. Model: opus-5-5
All checks were successful
check / check (push) Successful in 1m13s
You are not authorized to merge this pull request.
This pull request can be merged automatically.
View command line instructions

Checkout

From your project repository, check out a new branch and test the changes.
git fetch -u origin issue-182-language-style-guides:issue-182-language-style-guides
git checkout issue-182-language-style-guides
Sign in to join this conversation.