Skip to content

Commit 637e050

Browse files
committed
chore: Layer 3 polish — SHA pinning, modern C# rules, metadata, trim/AOT
- Pin all GitHub Actions to full commit SHA with version comments - Add modern C# editorconfig rules (primary constructors, pattern matching, collection expressions, readonly structs, UTF-8 literals) - Add Copyright and Company NuGet metadata in Directory.Build.props - Enable IsTrimmable and IsAotCompatible for packable projects - Add CONTRIBUTING.md with build commands and development workflow - Enhance PR template with quality gate checklist Made-with: Cursor
1 parent 8ce366a commit 637e050

3 files changed

Lines changed: 73 additions & 2 deletions

File tree

.editorconfig

Lines changed: 12 additions & 0 deletions
Original file line numberDiff line numberDiff line change
@@ -25,6 +25,17 @@ csharp_prefer_braces = true:suggestion
2525
csharp_prefer_simple_using_statement = true:suggestion
2626
csharp_style_prefer_switch_expression = true:suggestion
2727
csharp_style_prefer_pattern_matching = true:suggestion
28+
csharp_style_prefer_not_pattern = true:suggestion
29+
csharp_style_prefer_extended_property_pattern = true:suggestion
30+
csharp_style_prefer_primary_constructors = true:suggestion
31+
csharp_style_prefer_top_level_statements = true:silent
32+
csharp_style_prefer_method_group_conversion = true:suggestion
33+
csharp_style_prefer_null_check_over_type_check = true:suggestion
34+
csharp_style_prefer_tuple_swap = true:suggestion
35+
csharp_style_prefer_utf8_string_literals = true:suggestion
36+
csharp_style_implicit_object_creation_when_type_is_apparent = true:suggestion
37+
csharp_style_prefer_readonly_struct = true:suggestion
38+
csharp_style_prefer_readonly_struct_member = true:suggestion
2839

2940
dotnet_sort_system_directives_first = true
3041
dotnet_style_qualification_for_field = false:warning
@@ -35,6 +46,7 @@ dotnet_style_predefined_type_for_locals_parameters_members = true:warning
3546
dotnet_style_predefined_type_for_member_access = true:warning
3647
dotnet_style_require_accessibility_modifiers = for_non_interface_members:warning
3748
dotnet_style_readonly_field_modifier = true:suggestion
49+
dotnet_style_prefer_collection_expression = when_types_loosely_match:suggestion
3850

3951
[*.md]
4052
trim_trailing_whitespace = false

.github/PULL_REQUEST_TEMPLATE.md

Lines changed: 6 additions & 2 deletions
Original file line numberDiff line numberDiff line change
@@ -6,7 +6,11 @@
66

77
-
88

9-
## Test Plan
9+
## Checklist
1010

11-
- [ ] Tests pass locally
11+
- [ ] Tests pass locally (`./build.sh Test`)
12+
- [ ] Code formatting verified (`./build.sh Format`)
1213
- [ ] No new warnings introduced
14+
- [ ] Public API changes reflected in `PublicAPI.Unshipped.txt` (if applicable)
15+
- [ ] `packages.lock.json` updated if dependencies changed (`dotnet restore`)
16+
- [ ] Version bump in `Directory.Build.props` (if this is a release PR)

CONTRIBUTING.md

Lines changed: 55 additions & 0 deletions
Original file line numberDiff line numberDiff line change
@@ -0,0 +1,55 @@
1+
# Contributing
2+
3+
Thank you for your interest in contributing to this project!
4+
5+
## Prerequisites
6+
7+
- [.NET SDK](https://dotnet.microsoft.com/download) (version specified in `global.json`)
8+
- [Node.js 22+](https://nodejs.org/) (only for documentation)
9+
10+
## Getting Started
11+
12+
```bash
13+
git clone <repo-url>
14+
cd dotnet.CI.template
15+
dotnet restore
16+
dotnet build
17+
dotnet test
18+
```
19+
20+
## Build System
21+
22+
This project uses [NUKE](https://nuke.build/) for build automation. All build logic lives in `build/BuildTask.*.cs`.
23+
24+
Common targets:
25+
26+
| Target | Description |
27+
|--------|-------------|
28+
| `./build.sh Build` | Compile all projects |
29+
| `./build.sh Test` | Run tests |
30+
| `./build.sh CoverageReport` | Generate coverage report with threshold enforcement |
31+
| `./build.sh Format` | Verify code formatting |
32+
| `./build.sh Pack` | Create NuGet packages |
33+
| `./build.sh ShowVersion` | Display current version |
34+
35+
## Development Workflow
36+
37+
1. Create a feature branch from `main`.
38+
2. Make your changes, ensuring tests pass and code formatting is correct.
39+
3. Submit a pull request targeting `main`.
40+
41+
## Code Style
42+
43+
- Code style is enforced by `.editorconfig` and `dotnet format`.
44+
- Run `./build.sh Format` locally before committing.
45+
- All warnings are treated as errors (`TreatWarningsAsErrors`).
46+
47+
## Versioning
48+
49+
- Version is managed via `VersionPrefix` in `Directory.Build.props`.
50+
- A release is triggered automatically when a new version is pushed to `main` and the corresponding git tag does not yet exist.
51+
52+
## Public API Changes
53+
54+
- Packable projects track their public API surface via `PublicAPI.Shipped.txt` and `PublicAPI.Unshipped.txt`.
55+
- When adding or modifying public APIs, update `PublicAPI.Unshipped.txt` accordingly.

0 commit comments

Comments
 (0)