From f35c4bb12e8a9b64797a7d28854f1c33408ae50c Mon Sep 17 00:00:00 2001 From: Chris Green Date: Tue, 10 Feb 2026 09:16:49 -0600 Subject: [PATCH 1/2] Further improve text-file ending requirements MIME-Version: 1.0 Content-Type: text/plain; charset=UTF-8 Content-Transfer-Encoding: 8bit - Copilot managed to misinterpret the existing instructions—again; now fixed. --- .github/copilot-instructions.md | 4 ++-- 1 file changed, 2 insertions(+), 2 deletions(-) diff --git a/.github/copilot-instructions.md b/.github/copilot-instructions.md index fa4e39242..7d994b6a4 100644 --- a/.github/copilot-instructions.md +++ b/.github/copilot-instructions.md @@ -102,8 +102,8 @@ If the workspace root contains a `srcs/` directory, it may contain symbolic link ### CRITICAL: Apply to ALL files you create or edit (bash scripts, Python, C++, YAML, Markdown, etc.) -- All text files must have their final line be non-empty and terminated with a single newline character, leaving no trailing blank lines -- **Never add trailing whitespace on any line** (spaces or tabs at end of lines) +- For all text files, the final character in the file **must** be a newline character, and the immediately-preceding character **must not** be either a newline character or other whitespace (space, tab, etc.) +- **Never add trailing whitespace on any line** (spaces or tabs at end of lines) unless it is part of a multi-line string - This includes blank lines - they should contain only the newline character, no spaces or tabs - Exception: Markdown two-space line breaks (avoid; use proper paragraph breaks instead) From b7afc500c303a3c4ff18bc9add05860733dc186a Mon Sep 17 00:00:00 2001 From: Copilot <198982749+Copilot@users.noreply.github.com> Date: Tue, 10 Feb 2026 09:59:30 -0600 Subject: [PATCH 2/2] Eliminate ambiguity in text file ending requirements (#307) * Initial plan * Clarify text file ending requirements to eliminate ambiguity Co-authored-by: greenc-FNAL <2372949+greenc-FNAL@users.noreply.github.com> * Completely rewrite text formatting instructions for absolute clarity Co-authored-by: greenc-FNAL <2372949+greenc-FNAL@users.noreply.github.com> --------- Co-authored-by: copilot-swe-agent[bot] <198982749+Copilot@users.noreply.github.com> Co-authored-by: greenc-FNAL <2372949+greenc-FNAL@users.noreply.github.com> --- .github/copilot-instructions.md | 33 +++++++++++++++++++++++++++++---- 1 file changed, 29 insertions(+), 4 deletions(-) diff --git a/.github/copilot-instructions.md b/.github/copilot-instructions.md index 7d994b6a4..bafa3e7f8 100644 --- a/.github/copilot-instructions.md +++ b/.github/copilot-instructions.md @@ -102,10 +102,35 @@ If the workspace root contains a `srcs/` directory, it may contain symbolic link ### CRITICAL: Apply to ALL files you create or edit (bash scripts, Python, C++, YAML, Markdown, etc.) -- For all text files, the final character in the file **must** be a newline character, and the immediately-preceding character **must not** be either a newline character or other whitespace (space, tab, etc.) -- **Never add trailing whitespace on any line** (spaces or tabs at end of lines) unless it is part of a multi-line string -- This includes blank lines - they should contain only the newline character, no spaces or tabs -- Exception: Markdown two-space line breaks (avoid; use proper paragraph breaks instead) +#### File Ending Requirements + +All text files must end with exactly one newline character, with no trailing blank lines or trailing whitespace: + +- The final character in every file **must** be a single newline character (`\n`) +- The character immediately before the final newline **must not** be another newline (no trailing blank lines at EOF) +- The character immediately before the final newline **must not** be a space or tab (no trailing whitespace on the last line) + +**Correct example** (ends with `t\n`): + +```text +line 1 +last line content +``` + +**Incorrect examples**: + +- File ending with `t\n\n` (blank line at EOF - two consecutive newlines) +- File ending with `t \n` (trailing space before final newline) +- File ending with no newline (file must end with exactly one `\n`) + +#### No Trailing Whitespace on Any Line + +No line in the file should have trailing spaces or tabs: + +- **Never add trailing whitespace** (spaces or tabs) at the end of any line in the file +- This applies to all lines including blank lines within the file +- Blank lines within the file content should contain only a newline character, with no spaces or tabs +- Note: Language string literals that require specific whitespace will preserve it through language semantics, not through the source file format ## Comments and Documentation