Development guidelines for contributing to Humanizer, a .NET library for human-friendly text manipulation across multiple locales and frameworks
Guidelines for developing and contributing to the Humanizer .NET library - a comprehensive solution for turning numbers, dates, times, enums, quantities, etc. into human-friendly text across many locales.
Use the latest .NET SDK (see install script in `.github/copilot-instructions.md`):
```bash
dotnet --version
```
```csharp
// Good
var result = someMethod();
string userName = "example";
// Avoid unnecessary this. and braces for one-line blocks
if (condition)
DoSomething();
```
```csharp
[UseCulture("en-US")]
[Fact]
public void SomeLocalizationTest()
{
// Test implementation
}
```
```bash
dotnet test src/Humanizer.Tests/Humanizer.Tests.csproj --framework net10.0
dotnet test src/Humanizer.Tests/Humanizer.Tests.csproj --framework net8.0
```
```bash
dotnet build Humanizer/Humanizer.csproj -c Release /t:PackNuSpecs /p:PackageOutputPath=<path>
```
```bash
./verify-packages.ps1
./verify-packages.ps1 -MinimumPassingSdkVersion "9.0.100"
```
1. **Resource Files**
- Duplicate relevant resource files under `src/Humanizer/Properties`
- Translate content appropriately
2. **Register Formatters**
- Add to `Configuration/FormatterRegistry.cs`
- Update number converter factories
3. **Testing**
- Create tests under `src/Humanizer.Tests/Localisation/{culture}`
- Use `UseCulture` attribute for culture-specific tests
1. Implement feature in `src/Humanizer`
2. Add comprehensive tests in `src/Humanizer.Tests`
3. Update XML documentation
4. Test across all target frameworks
5. Update readme if user-facing
1. Add resource files for new culture
2. Implement culture-specific formatters
3. Register in appropriate registries
4. Create targeted tests
5. Verify with culture-specific test runs
1. Build with release configuration
2. Verify packages with verification script
3. Test package references in isolated environment
4. Ensure no NuGet.config changes are committed
Leave a review
No reviews yet. Be the first to review this skill!
# Download SKILL.md from killerskills.ai/api/skills/humanizer-net-library-development/raw