From ff42f4013dece88000b4b1ae43fa84ebf196acbc Mon Sep 17 00:00:00 2001 From: clawbot Date: Mon, 9 Nov 2026 22:31:17 +0000 Subject: [PATCH] Correct the kept-lines bullet; test .editorconfig with no own line REPO_POLICIES said an ignore file lacking the closing comment keeps every line the canonical file has never held; blank lines and comments are dropped, so it now says entries, in a bullet of its own. A new scenario covers an .editorconfig lacking the comment with no line of its own, which the script replaces. Model: opus-5-5 --- prompts/REPO_POLICIES.md | 6 +++--- test/update-policy.sh | 8 ++++++++ 2 files changed, 11 insertions(+), 3 deletions(-) diff --git a/prompts/REPO_POLICIES.md b/prompts/REPO_POLICIES.md index 2218bb3..0e2d201 100644 --- a/prompts/REPO_POLICIES.md +++ b/prompts/REPO_POLICIES.md @@ -951,9 +951,9 @@ style conventions are in separate documents: files is at the top of `script/install`. The script replaces each file and keeps only the repo's own entries: - in `.gitignore`, `.editorconfig` and `.dockerignore`: the lines below the - comment that ends the canonical file, and, in a `.gitignore` or - `.dockerignore` lacking that comment, every line the canonical file has - never held + comment that ends the canonical file + - in a `.gitignore` or `.dockerignore` lacking that comment: every entry the + canonical file has never held - in `.golangci.yml`: the entries the repo added to the `deny` list of the `test-support` depguard rule diff --git a/test/update-policy.sh b/test/update-policy.sh index 4c1c144..79399f1 100755 --- a/test/update-policy.sh +++ b/test/update-policy.sh @@ -737,6 +737,13 @@ test_editorconfig_lacks_canonical_last_line() { expect_nothing_written } +test_editorconfig_lacks_canonical_last_line_no_own_line() { + start_scenario ".editorconfig lacking the canonical last line with no line of its own is replaced" + printf 'root = true\n[*]\n' > "$dir/repo/.editorconfig" + expect_former_canonical_line_replaced .editorconfig "indent_size = 8" + expect_same_as_canonical .editorconfig +} + test_fetched_golangci_without_deny_list() { start_scenario "a fetched .golangci.yml with no deny list stops" cat > "$dir/canonical/.golangci.yml" << 'EOF' @@ -888,6 +895,7 @@ main() { test_gitignore_lacks_canonical_last_line test_dockerignore_lacks_canonical_last_line test_editorconfig_lacks_canonical_last_line + test_editorconfig_lacks_canonical_last_line_no_own_line test_fetched_golangci_without_deny_list test_own_golangci_setting_stops test_source_repo_stops