-
Notifications
You must be signed in to change notification settings - Fork 10.5k
Ensure template files end with newline and add validation test #64814
New issue
Have a question about this project? Sign up for a free GitHub account to open an issue and contact its maintainers and the community.
By clicking “Sign up for GitHub”, you agree to our terms of service and privacy statement. We’ll occasionally send you account related emails.
Already on GitHub? Sign in to your account
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>
There was a problem hiding this comment.
Choose a reason for hiding this comment
The reason will be displayed to describe this comment to others. Learn more.
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 |
Co-authored-by: javiercn <6995051+javiercn@users.noreply.github.com>
|
@copilot fix the merge conflicts |
…zation files Co-authored-by: javiercn <6995051+javiercn@users.noreply.github.com>
Ma202010
left a comment
There was a problem hiding this comment.
Choose a reason for hiding this comment
The reason will be displayed to describe this comment to others. Learn more.
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.