Skip to content

Remove trailing whitespaces from tests - #20355

Merged
T-Gro merged 3 commits into
dotnet:mainfrom
xperiandri:remove-trailing-whitespace
Sep 2, 2026
Merged

Remove trailing whitespaces from tests#20355
T-Gro merged 3 commits into
dotnet:mainfrom
xperiandri:remove-trailing-whitespace

Conversation

@xperiandri

@xperiandri xperiandri commented Aug 25, 2026

Copy link
Copy Markdown
Contributor

Description

Removes trailing whitespace from F# sources under tests/, vsintegration/tests, buildtools/ and docs/fcs-samples (2932 files).

src/ and vsintegration/src were split out into #20393 so that each PR stays under the 3000-file limit enforced by check_release_notes — that check fails closed at >= 3000 changed files, before the NO_RELEASE_NOTES opt-out is even evaluated. No protected path is touched here, so this PR needs no release notes; #20393 carries them.

No functional changes

Trailing whitespace is preserved wherever it is semantically significant. Lines whose end falls inside a multi-line string literal (STRING_TEXT) or inside an inactive #if region are left untouched. Those lines were classified with FSharp.Compiler.Tokenization.FSharpSourceTokenizer rather than a regex.

This matters here specifically: many tests embed expected IL and expected compiler output in triple-quoted strings, where trailing spaces are part of the baseline being compared. The earlier revision of this PR stripped 2936 such lines across 161 files, which is what broke CI.

Verification:

  • git diff -w reports no non-whitespace differences beyond 30 removed lines that consist only of whitespace and were the final, newline-less line of their file. None of the tests/fsharp/typecheck/sigs .bsl baselines reference a removed line.
  • Tokenizing every touched file before and after with the F# tokenizer shows the string-literal token stream is byte-identical (2932/2932 files).

Blame

Per @nojaf's suggestion, an entry was added to .git-blame-ignore-revs.

Note that this repository squash-merges, so the recorded SHA points at the branch commit and will need rewriting to the squashed commit SHA afterwards — the same caveat the file's own header documents for the existing entries. #20393's SHA should be added in that same follow-up.

@github-actions

github-actions Bot commented Aug 25, 2026

Copy link
Copy Markdown
Contributor

⚠️ Release notes required, but author opted out

Warning

Author opted out of release notes, check is disabled for this pull request.
cc @dotnet/fsharp-team-msft

@github-actions github-actions Bot added the ⚠️ Affects-Build-Infra Tooling check: PR touches build infrastructure label Aug 25, 2026
@github-actions

Copy link
Copy Markdown
Contributor

🔍 Tooling Safety Check — Affects-Build-Infra
Affects-Build-Infra: modifies eng/Build.ps1 (build script)

Generated by PR Tooling Safety Check · opus46 4.6M ·

@nojaf

nojaf commented Aug 25, 2026

Copy link
Copy Markdown
Contributor

Would probably be best to have an entry in https://github.com/dotnet/fsharp/blob/main/.git-blame-ignore-revs as well for this.

@xperiandri
xperiandri force-pushed the remove-trailing-whitespace branch from 0301a07 to d8e6673 Compare August 26, 2026 17:08

@T-Gro T-Gro left a comment

Copy link
Copy Markdown
Member

Choose a reason for hiding this comment

The reason will be displayed to describe this comment to others. Learn more.

Approved but pls include the ignore from git blame.

Also CI is failing.

@github-project-automation github-project-automation Bot moved this from New to In Progress in F# Compiler and Tooling Aug 27, 2026
@T-Gro T-Gro added the NO_RELEASE_NOTES Label for pull requests which signals, that user opted-out of providing release notes label Aug 27, 2026
@xperiandri
xperiandri force-pushed the remove-trailing-whitespace branch 2 times, most recently from 9783b54 to c065d76 Compare August 29, 2026 01:42
@xperiandri xperiandri changed the title Remove all trailing whitespaces Remove trailing whitespaces from tests Aug 29, 2026
@auduchinok

Copy link
Copy Markdown
Member

The ignore from git blame should probably be another PR, because the commits from this PR are going to squashed.

@nojaf

nojaf commented Sep 1, 2026

Copy link
Copy Markdown
Contributor

The ignore from git blame should probably be another PR, because the commits from this PR are going to squashed.

Yes, you can't squash this indeed.

xperiandri and others added 3 commits September 1, 2026 14:29
Strips trailing whitespace from F# sources under tests/, vsintegration/tests,
buildtools/ and docs/fcs-samples.

Trailing whitespace is preserved wherever it is semantically significant:
lines whose end falls inside a multi-line string literal (STRING_TEXT) or
inside an inactive `#if` region are left untouched. Those lines were
classified with FSharp.Compiler.Tokenization.FSharpSourceTokenizer rather
than a regex, because many tests embed expected IL / expected compiler
output in triple-quoted strings where trailing spaces are part of the
baseline being compared -- stripping those was what broke CI previously.

Verified with the F# tokenizer: the string-literal token stream is
byte-identical before and after for every file touched.

src/ and vsintegration/src are split out into a separate PR so that each
stays under the 3000-file limit enforced by the release-notes check.

Co-Authored-By: Claude Opus 5 (1M context) <noreply@anthropic.com>
Note: dotnet/fsharp squash-merges PRs, so this SHA points at the branch
commit and will need rewriting to the squashed commit SHA afterwards --
the same caveat the file's own header documents for the existing entries.
The companion src-only PR's SHA should be added in that same follow-up.

Co-Authored-By: Claude Opus 5 (1M context) <noreply@anthropic.com>
These files are parse-tree fixtures whose `.bsl` baselines assert exact
column ranges, so the trailing space is part of what is being parsed:

* `Unfinished escaped ident 01.fs` - the space sits inside an unterminated
  escaped identifier, which the lexer consumes to end of line.
* `SynTypeFunHasRangeOfArrow.fs` - inside a line comment, whose range is
  printed via `ParsedInputTrivia.CodeComments`.
* `RegressionOptionType.fs` - on the final, newline-less line.

Co-Authored-By: Claude Opus 5 (1M context) <noreply@anthropic.com>
@xperiandri
xperiandri force-pushed the remove-trailing-whitespace branch from e1dc879 to a75e648 Compare September 1, 2026 12:29
xperiandri added a commit to xperiandri/fsharp that referenced this pull request Sep 1, 2026
Strips trailing whitespace from F# sources under src/ and vsintegration/src,
plus eng/Build.ps1.

Trailing whitespace is preserved wherever it is semantically significant:
lines whose end falls inside a multi-line string literal (STRING_TEXT) or
inside an inactive `#if` region are left untouched. Those lines were
classified with FSharp.Compiler.Tokenization.FSharpSourceTokenizer rather
than a regex.

Verified with the F# tokenizer: the string-literal token stream is
byte-identical before and after for every file touched.

Split out of dotnet#20355 so that each PR stays under the 3000-file limit
enforced by the release-notes check.

Co-Authored-By: Claude Opus 5 (1M context) <noreply@anthropic.com>
@xperiandri

Copy link
Copy Markdown
Contributor Author

@T-Gro all green, can we merge?

xperiandri added a commit to xperiandri/fsharp that referenced this pull request Sep 1, 2026
Strips trailing whitespace from F# sources under src/ and vsintegration/src,
plus eng/Build.ps1.

Trailing whitespace is preserved wherever it is semantically significant:
lines whose end falls inside a multi-line string literal (STRING_TEXT) or
inside an inactive `#if` region are left untouched. Those lines were
classified with FSharp.Compiler.Tokenization.FSharpSourceTokenizer rather
than a regex.

Verified with the F# tokenizer: the string-literal token stream is
byte-identical before and after for every file touched.

Split out of dotnet#20355 so that each PR stays under the 3000-file limit
enforced by the release-notes check.

Co-Authored-By: Claude Opus 5 (1M context) <noreply@anthropic.com>
@T-Gro
T-Gro merged commit 9c3a877 into dotnet:main Sep 2, 2026
52 checks passed
@github-project-automation github-project-automation Bot moved this from In Progress to Done in F# Compiler and Tooling Sep 2, 2026
Sign up for free to join this conversation on GitHub. Already have an account? Sign in to comment

Labels

⚠️ Affects-Build-Infra Tooling check: PR touches build infrastructure NO_RELEASE_NOTES Label for pull requests which signals, that user opted-out of providing release notes

Projects

Archived in project

Development

Successfully merging this pull request may close these issues.

4 participants