From f5d14d997e42bd7b990ca74bf64480e81e512404 Mon Sep 17 00:00:00 2001 From: Lilleman auf Larv Date: Thu, 26 Nov 2026 07:45:28 +0100 Subject: [PATCH] File item 542: report space-indented code that no setting explains --- todo.md | 21 ++++++++++++++++++++- 1 file changed, 20 insertions(+), 1 deletion(-) diff --git a/todo.md b/todo.md index 73564e31..f6fa1116 100644 --- a/todo.md +++ b/todo.md @@ -6,7 +6,7 @@ `Bar = 0.1` -`Next ID = 542` +`Next ID = 543` ## Items @@ -18,6 +18,7 @@ | 525 | 0.16.0 | | owner | **Write fejkdata's first five source-data tasks for `task-bench`, each a seeded register for a made-up country, a spec, a checker and a reference patch, in the `bench-tasks` folder its config names.** | 3 | 2 | 1 | 4 | 7 | 1.1 by 3 | 0.3 | | 477 | 0.17.0 | | question | **Rewrite `## Goals` and `## Audience` for a setup others install and run apart from their own `~/.claude`.** | 1 | 1 | 2 | 2 | 2 | | 0.0 | | 478 | 0.17.0 | | question | **Name the project, its repo and its two commands, today proposed as `do-release` and `do-epic`.** | 1 | 1 | 2 | 2 | 1 | | 0.0 | +| 542 | 0.17.0 | | | **Make chunk-preflight report a project whose code is space-indented with no `.editorconfig` or formatter setting that says so, and narrow the tabs principle to explicit overrides.** | 2 | 2 | 3 | 5 | 4 | 1.1 by 4 | 1.2 | | 523 | 0.17.0 | | | **Make the security pass and stability-reviewer check that a new secret's docs name its scope and its reach, such as the other repositories its account can use.** | 1 | 1 | 2 | 2 | 1 | 1.1 by 2 | 0.9 | | 537 | 0.17.0 | | | **Flag regexes that use `$` to validate a whole input, since `$` also matches before a final newline.** | 1 | 2 | 2 | 3 | 1 | 1.1 by 2 | 0.9 | | 538 | 0.17.0 | | | **Flag validation that checks a value other than the one the code goes on to use, such as before trimming, stripping or converting it.** | 1 | 2 | 2 | 3 | 1 | 1.1 by 2 | 0.9 | @@ -173,6 +174,24 @@ Part of the standalone-install plan lilleman approved on 2026-11-20. `do-release Part of the standalone-install plan lilleman approved on 2026-11-20. Later items say `do-release` and `do-epic` for the names this item picks. The names set the install folders, such as `~/.config/do-release/`, so items 482, 485 and 496, and every item they block, wait for them. +### 542. Make chunk-preflight report a project whose code is space-indented with no `.editorconfig` or formatter setting that says so, and narrow the tabs principle to explicit overrides. + +`principles/technical-principles.md` says "Indent with hard tabs by default. A project's own settings win: `.editorconfig`, linter/formatter config, or the surrounding file's existing indentation." The last clause lets a first session set spaces and every later session follow it, and nothing checks that anyone chose it. adf-codec's `AGENTS.md` has said "Two-space indent" since its first commit, with no reason, and 177 code files, 14,500 indented lines, followed it. A survey of the projects on this machine on 2026-11-26 found the same in plainpages, scheduler (`rustfmt.toml` doesn't set `hard_tabs`), oss-opportunity-research, secondhand-watch and playwright-for-agents. Only plainpages-plugin-fastjira says so in an `.editorconfig`. + +Two changes, the tool first: + +- `chunk-preflight` prints one fact where the project's tracked code (the files its language tooling covers, not Markdown, JSON or YAML) has more space-indented than tab-indented lines, and neither an `.editorconfig` with `indent_style` nor a formatter setting (`rustfmt.toml` `hard_tabs`, Prettier `useTabs`, Biome `indentStyle`) says so. The fact names the principle and the two ways out: convert to tabs, or record the override in `.editorconfig` and a decision. It reports and never fails, since a client's repo belongs to its team. +- The principle's override clause counts only a setting a tool reads, `.editorconfig` or a formatter's config, plus a decision in `docs/decisions.md` that names the reason. A prose rule in `AGENTS.md`, or the existing files' habit, no longer overrides it. Output formats a spec fixes, such as a spelling's JSON, are outside the rule. + +Test it with a fake checkout per case: tabs, spaces with a setting, spaces without one, and a repo of Markdown only. + +Touches: + +- `bin/chunk_preflight/facts.py` +- `bin/chunk_preflight/gathered.py` +- `bin/chunk_preflight/test_chunk_preflight.py` +- `principles/technical-principles.md`: `* Indent with hard tabs by default.` (small) + ### 523. Make the security pass and stability-reviewer check that a new secret's docs name its scope and its reach, such as the other repositories its account can use. An outside reviewer found it on a client project's PR that added a secret: a Gitea token documented as able to run Actions on one repository, "and nothing wider". The token reaches every repository its owning account can, so the docs had to require a dedicated account with access to that repository only. Neither `/security-review` nor stability-reviewer raised it. Where a change adds a secret or a token, ask each to check that the doc beside it states what the credential can reach, not only what the change uses it for.