Skip to content

Commit 3e61e3e

Browse files
chore: align project configuration with NuGet library template best practices (#53)
Compared TrxLib against the upstream [NuGet library template](https://github.com/BenjaminMichaelis/DotnetTemplates/tree/main/templates/Library/NuGet) and applied the improvements that were missing. ## Changes - **Transitive pinning** (`Directory.Packages.props`): Enables `CentralPackageTransitivePinningEnabled`, which pins transitive dependencies to the versions declared in CPM. This prevents supply-chain surprises where a transitive upgrade quietly pulls in a vulnerable or breaking version. - **LangVersion 14** (`Directory.Build.props`): Updates from `13.0` to `14` to use the latest C# language features and match current template conventions. - **Line endings: CRLF -> LF** (`.editorconfig`, `.gitattributes`): Switches `end_of_line` from `crlf` to `lf` for cross-platform consistency and cleaner Git diffs. Also enables `insert_final_newline`. A `.gitattributes` file is added to enforce normalization at the repo level. - **PackageTags** (`Directory.Build.props`): Adds `trx test-results xml parser` so the package is discoverable on NuGet.org by relevant search terms. ## Not changed TrxLib's existing metadata (Title, Authors, Description, License, URLs, README) was already in excellent shape -- no changes needed there. `IsTestProject=true` was already set in the test csproj.
1 parent ec598cd commit 3e61e3e

4 files changed

Lines changed: 40 additions & 3 deletions

File tree

.editorconfig

Lines changed: 2 additions & 2 deletions
Original file line numberDiff line numberDiff line change
@@ -26,8 +26,8 @@ indent_size = 4
2626
tab_width = 4
2727

2828
# New line preferences
29-
end_of_line = crlf
30-
insert_final_newline = false
29+
end_of_line = lf
30+
insert_final_newline = true
3131

3232
#### .NET Coding Conventions ####
3333
[*.{cs,vb}]

.gitattributes

Lines changed: 35 additions & 0 deletions
Original file line numberDiff line numberDiff line change
@@ -0,0 +1,35 @@
1+
# Auto normalize line endings for all tracked files
2+
* text=auto
3+
4+
# Explicitly normalize to LF for text files
5+
*.cs text eol=lf
6+
*.csproj text eol=lf
7+
*.props text eol=lf
8+
*.targets text eol=lf
9+
*.sln text eol=lf
10+
*.slnx text eol=lf
11+
*.md text eol=lf
12+
*.json text eol=lf
13+
*.xml text eol=lf
14+
*.yml text eol=lf
15+
*.yaml text eol=lf
16+
*.config text eol=lf
17+
*.editorconfig text eol=lf
18+
*.gitignore text eol=lf
19+
*.gitattributes text eol=lf
20+
21+
# Binary files
22+
*.png binary
23+
*.jpg binary
24+
*.jpeg binary
25+
*.gif binary
26+
*.ico binary
27+
*.mov binary
28+
*.mp4 binary
29+
*.mp3 binary
30+
*.gz binary
31+
*.zip binary
32+
*.7z binary
33+
*.ttf binary
34+
*.otf binary
35+
*.fnt binary

Directory.Build.props

Lines changed: 2 additions & 1 deletion
Original file line numberDiff line numberDiff line change
@@ -11,7 +11,7 @@ See: https://learn.microsoft.com/visualstudio/msbuild/customize-your-build
1111
<PropertyGroup>
1212
<ImplicitUsings>enable</ImplicitUsings>
1313
<Nullable>enable</Nullable>
14-
<LangVersion>13.0</LangVersion>
14+
<LangVersion>14</LangVersion>
1515
<!--
1616
If you you like to see source generated files saved to disk you can enable the following:
1717
https://learn.microsoft.com/en-us/dotnet/csharp/roslyn-sdk/source-generators-overview
@@ -42,6 +42,7 @@ See: https://learn.microsoft.com/visualstudio/msbuild/customize-your-build
4242
<PackageProjectUrl>https://github.com/BenjaminMichaelis/TrxLib</PackageProjectUrl>
4343
<PackageReadmeFile>README.md</PackageReadmeFile>
4444
<PackageRequireLicenseAcceptance>true</PackageRequireLicenseAcceptance>
45+
<PackageTags>trx;test-results;xml;parser</PackageTags>
4546
</PropertyGroup>
4647

4748
<PropertyGroup Label="SourceLink">

Directory.Packages.props

Lines changed: 1 addition & 0 deletions
Original file line numberDiff line numberDiff line change
@@ -11,6 +11,7 @@
1111
<!-- This property enables the Central Package Management feature -->
1212
<PropertyGroup>
1313
<ManagePackageVersionsCentrally>true</ManagePackageVersionsCentrally>
14+
<CentralPackageTransitivePinningEnabled>true</CentralPackageTransitivePinningEnabled>
1415
</PropertyGroup>
1516
<!--
1617
This defines the set of centrally managed packages.

0 commit comments

Comments
 (0)