Skip to content

Conversation

Copy link
Contributor

Copilot AI commented Dec 18, 2025

Ensure template files end with newline and add validation test

  • You've read the Contributor Guide and Code of Conduct.
  • You've included unit or integration tests for your change, where applicable.
  • You've included inline docs for your change, where applicable.
  • There's an open issue for the PR that you are making. If you'd like to propose a new feature or change, please open an issue to discuss the change or find an existing issue.

Fix template files missing trailing newlines

Description

GitHub tooling complains when files don't end with a newline. Fixed 26 template files across source code, CSS, and configuration files by adding trailing newlines.

Added NewlineEndingTest:

  • Validates all template files end with newline (LF/0x0a)
  • Mirrors existing ByteOrderMarkTest pattern
  • Excludes third-party libraries (wwwroot/lib/*) and auto-generated localization files (.template.config/localize/*)

Fixed files:

  • 4 source files: .fs, .razor
  • 5 CSS files
  • 17 configuration files: template.json, dotnetcli.host.json, ide.host.json, strings.json
Original prompt

This section details on the original issue you should resolve

<issue_title>NIT: Returns in project template files</issue_title>
<issue_description>### Is there an existing issue for this?

  • I have searched the existing issues

Describe the bug

NIT, so only if interested ......

GH complains about files not ending on a blank line (i.e., LF on the last code line). The BWA template has at least one example ...

https://github.com/dotnet/aspnetcore/blob/main/src/ProjectTemplates/Web.ProjectTemplates/content/BlazorWeb-CSharp/BlazorWebCSharp.1/Components/Pages/NotFound.razor

[Edit the file to witness it.]

Do you want to go through and confirm/update any files for this?

Expected Behavior

No response

Steps To Reproduce

No response

Exceptions (if any)

No response

.NET Version

No response

Anything else?

No response</issue_description>

<agent_instructions>Prepare a PR. Be sensible and avoid any file that shouldn't get this treatment, indicate so in your summary (which files you didn't change and the reason). We should also include a check similar to the one that we have for BOM on files.</agent_instructions>

Comments on the Issue (you are @copilot in this section)

@ilonatommy @guardrex, just to clarify, are you suggesting here that we should always have a blank line in our template files? @javiercn @guardrex thanks for the clarification.

I think if this is the case, we would probably treat it similarly to the BOM and make sure that every file has the line ending and that we have tests that validate they get generated with it.

@guardrex any examples where GH is complaining? I imagine you mean copilot.</comment_new>
<comment_new>@javiercn
Hmm, not sure if this is a manual thing or if has been caused by .gitattributes.</comment_new>


💬 We'd love your input! Share your thoughts on Copilot coding agent in our 2 minute survey.

@dotnet-policy-service
Copy link
Contributor

Greetings! You've submitted a PR that modifies code that is shared with https://github.com/dotnet/runtime . Please make sure you synchronize this code with the changes in that repo!

Copilot AI and others added 3 commits December 18, 2025 13:16
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
Copilot AI requested a review from javiercn December 18, 2025 13:25
Sign up for free to join this conversation on GitHub. Already have an account? Sign in to comment

Projects

None yet

Development

Successfully merging this pull request may close these issues.

NIT: Returns in project template files

2 participants