Ensure template files end with newline and add validation test#64814
Merged
Ensure template files end with newline and add validation test#64814
Conversation
Co-authored-by: javiercn <6995051+javiercn@users.noreply.github.com>
Co-authored-by: javiercn <6995051+javiercn@users.noreply.github.com>
Co-authored-by: javiercn <6995051+javiercn@users.noreply.github.com>
Copilot
AI
changed the title
[WIP] Fix missing blank lines in project template files
Ensure template files end with newline and add validation test
Dec 18, 2025
This was referenced Dec 18, 2025
Contributor
There was a problem hiding this comment.
Pull request overview
This PR addresses GitHub tooling complaints about files not ending with newlines by fixing 26 template files and adding a validation test to prevent future occurrences.
Key Changes:
- Added
NewlineEndingTestthat validates all template files end with a newline (LF/0x0a), mirroring the existingByteOrderMarkTestpattern - Fixed 26 template files across source code (.fs, .razor), CSS, and configuration files (template.json, dotnetcli.host.json, ide.host.json, strings.json)
- Excluded third-party libraries (
wwwroot/lib/*) and auto-generated localization files (.template.config/localize/*) from validation
Reviewed changes
Copilot reviewed 1 out of 27 changed files in this pull request and generated no comments.
Show a summary per file
| File | Description |
|---|---|
| src/ProjectTemplates/test/Templates.Tests/NewlineEndingTest.cs | New test class that validates template files end with newline; checks multiple file types and excludes third-party/auto-generated content |
| src/ProjectTemplates/Web.ProjectTemplates/content/Worker-FSharp/Program.fs | Added trailing newline to F# source file |
| src/ProjectTemplates/Web.ProjectTemplates/content/WebApiAot-CSharp/.template.config/template.json | Added trailing newline to template configuration |
| src/ProjectTemplates/Web.ProjectTemplates/content/WebApiAot-CSharp/.template.config/ide.host.json | Added trailing newline to IDE host configuration |
| src/ProjectTemplates/Web.ProjectTemplates/content/WebApiAot-CSharp/.template.config/dotnetcli.host.json | Added trailing newline to dotnet CLI host configuration |
| src/ProjectTemplates/Web.ProjectTemplates/content/WebApi-CSharp/.template.config/zh-Hant/strings.json | Added trailing newline to Traditional Chinese localization strings |
| src/ProjectTemplates/Web.ProjectTemplates/content/WebApi-CSharp/.template.config/zh-Hans/strings.json | Added trailing newline to Simplified Chinese localization strings |
| src/ProjectTemplates/Web.ProjectTemplates/content/WebApi-CSharp/.template.config/tr/strings.json | Added trailing newline to Turkish localization strings |
| src/ProjectTemplates/Web.ProjectTemplates/content/WebApi-CSharp/.template.config/ru/strings.json | Added trailing newline to Russian localization strings |
| src/ProjectTemplates/Web.ProjectTemplates/content/WebApi-CSharp/.template.config/pt-BR/strings.json | Added trailing newline to Brazilian Portuguese localization strings |
| src/ProjectTemplates/Web.ProjectTemplates/content/WebApi-CSharp/.template.config/pl/strings.json | Added trailing newline to Polish localization strings |
| src/ProjectTemplates/Web.ProjectTemplates/content/WebApi-CSharp/.template.config/ko/strings.json | Added trailing newline to Korean localization strings |
| src/ProjectTemplates/Web.ProjectTemplates/content/WebApi-CSharp/.template.config/ja/strings.json | Added trailing newline to Japanese localization strings |
| src/ProjectTemplates/Web.ProjectTemplates/content/WebApi-CSharp/.template.config/it/strings.json | Added trailing newline to Italian localization strings |
| src/ProjectTemplates/Web.ProjectTemplates/content/WebApi-CSharp/.template.config/fr/strings.json | Added trailing newline to French localization strings |
| src/ProjectTemplates/Web.ProjectTemplates/content/WebApi-CSharp/.template.config/es/strings.json | Added trailing newline to Spanish localization strings |
| src/ProjectTemplates/Web.ProjectTemplates/content/WebApi-CSharp/.template.config/dotnetcli.host.json | Added trailing newline to dotnet CLI host configuration |
| src/ProjectTemplates/Web.ProjectTemplates/content/WebApi-CSharp/.template.config/de/strings.json | Added trailing newline to German localization strings |
| src/ProjectTemplates/Web.ProjectTemplates/content/WebApi-CSharp/.template.config/cs/strings.json | Added trailing newline to Czech localization strings |
| src/ProjectTemplates/Web.ProjectTemplates/content/StarterWeb-FSharp/wwwroot/css/site.css | Added trailing newline to F# starter web CSS file |
| src/ProjectTemplates/Web.ProjectTemplates/content/StarterWeb-CSharp/wwwroot/css/site.css | Added trailing newline to C# starter web CSS file |
| src/ProjectTemplates/Web.ProjectTemplates/content/RazorPagesWeb-CSharp/wwwroot/css/site.css | Added trailing newline to Razor Pages CSS file |
| src/ProjectTemplates/Web.ProjectTemplates/content/ComponentsWebAssembly-CSharp/wwwroot/css/app.css | Added trailing newline to WebAssembly app CSS file |
| src/ProjectTemplates/Web.ProjectTemplates/content/ComponentsWebAssembly-CSharp/Pages/NotFound.razor | Added trailing newline to WebAssembly NotFound page |
| src/ProjectTemplates/Web.ProjectTemplates/content/BlazorWeb-CSharp/BlazorWebCSharp.1/wwwroot/app.css | Added trailing newline to Blazor Web app CSS file |
| src/ProjectTemplates/Web.ProjectTemplates/content/BlazorWeb-CSharp/BlazorWebCSharp.1/Components/Pages/NotFound.razor | Added trailing newline to Blazor NotFound page |
| src/ProjectTemplates/Web.ProjectTemplates/content/BlazorWeb-CSharp/BlazorWebCSharp.1.Client/_Imports.razor | Added trailing newline to Blazor client imports file |
akoeplinger
reviewed
Dec 26, 2025
akoeplinger
approved these changes
Dec 27, 2025
Co-authored-by: javiercn <6995051+javiercn@users.noreply.github.com>
Member
|
@copilot fix the merge conflicts |
…zation files Co-authored-by: javiercn <6995051+javiercn@users.noreply.github.com>
Contributor
Author
4 tasks
This file contains hidden or bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
Sign up for free
to join this conversation on GitHub.
Already have an account?
Sign in to comment
Add this suggestion to a batch that can be applied as a single commit.This suggestion is invalid because no changes were made to the code.Suggestions cannot be applied while the pull request is closed.Suggestions cannot be applied while viewing a subset of changes.Only one suggestion per line can be applied in a batch.Add this suggestion to a batch that can be applied as a single commit.Applying suggestions on deleted lines is not supported.You must change the existing code in this line in order to create a valid suggestion.Outdated suggestions cannot be applied.This suggestion has been applied or marked resolved.Suggestions cannot be applied from pending reviews.Suggestions cannot be applied on multi-line comments.Suggestions cannot be applied while the pull request is queued to merge.Suggestion cannot be applied right now. Please check back later.
Ensure template files end with newline and add validation test
Fix template files missing trailing newlines
Description
GitHub tooling complains when files don't end with a newline. Fixed 375 template files across source code, CSS, configuration files, and localization files by adding trailing newlines.
Added
NewlineEndingTest:ByteOrderMarkTestpatternwwwroot/lib/*)Fixed files:
.fs,.razortemplate.json,dotnetcli.host.json,ide.host.json,strings.jsontemplatestrings.*.jsonin.template.config/localize/*Merge conflict resolution:
Original prompt
💬 We'd love your input! Share your thoughts on Copilot coding agent in our 2 minute survey.