Run CSharpier formatting and document check-format process

Co-authored-by: adamhathcock <527620+adamhathcock@users.noreply.github.com>
This commit is contained in:
copilot-swe-agent[bot]
2025-12-19 13:31:35 +00:00
parent 2f0eb0bd4b
commit c701bbbee3
2 changed files with 28 additions and 18 deletions

View File

@@ -32,12 +32,34 @@ SharpCompress is a pure C# compression library supporting multiple archive forma
- Use CSharpier for code formatting to ensure consistent style across the project
- CSharpier is configured as a local tool in `.config/dotnet-tools.json`
- **To format code, run the task: `format` task (which runs `dotnet csharpier .` from project root)**
- Restore tools with: `dotnet tool restore`
- Format files from the project root with: `dotnet csharpier .`
- Configure your IDE to format on save using CSharpier for the best experience
### Commands
1. **Restore tools** (first time only):
```bash
dotnet tool restore
```
2. **Check if files are formatted correctly** (doesn't modify files):
```bash
dotnet csharpier check .
```
- Exit code 0: All files are properly formatted
- Exit code 1: Some files need formatting (will show which files and differences)
3. **Format files** (modifies files):
```bash
dotnet csharpier format .
```
- Formats all files in the project to match CSharpier style
- Run from project root directory
4. **Configure your IDE** to format on save using CSharpier for the best experience
### Additional Notes
- The project also uses `.editorconfig` for editor settings (indentation, encoding, etc.)
- Let CSharpier handle code style while `.editorconfig` handles editor behavior
- Always run `dotnet csharpier check .` before committing to verify formatting
## Project Setup and Structure

View File

@@ -88,13 +88,7 @@ public static class IArchiveExtensions
// Update progress
bytesRead += entry.Size;
progress?.Report(
new ProgressReport(
entry.Key ?? string.Empty,
bytesRead,
totalBytes
)
);
progress?.Report(new ProgressReport(entry.Key ?? string.Empty, bytesRead, totalBytes));
}
}
@@ -149,13 +143,7 @@ public static class IArchiveExtensions
// Update progress
bytesRead += entry.Size;
progress?.Report(
new ProgressReport(
entry.Key ?? string.Empty,
bytesRead,
totalBytes
)
);
progress?.Report(new ProgressReport(entry.Key ?? string.Empty, bytesRead, totalBytes));
}
}
}