Proctorio.EditorConfig
2.0.0
See the version list below for details.
dotnet add package Proctorio.EditorConfig --version 2.0.0
NuGet\Install-Package Proctorio.EditorConfig -Version 2.0.0
<PackageReference Include="Proctorio.EditorConfig" Version="2.0.0"> <PrivateAssets>all</PrivateAssets> <IncludeAssets>runtime; build; native; contentfiles; analyzers</IncludeAssets> </PackageReference>
<PackageVersion Include="Proctorio.EditorConfig" Version="2.0.0" />
<PackageReference Include="Proctorio.EditorConfig"> <PrivateAssets>all</PrivateAssets> <IncludeAssets>runtime; build; native; contentfiles; analyzers</IncludeAssets> </PackageReference>
paket add Proctorio.EditorConfig --version 2.0.0
#r "nuget: Proctorio.EditorConfig, 2.0.0"
#:package Proctorio.EditorConfig@2.0.0
#addin nuget:?package=Proctorio.EditorConfig&version=2.0.0
#tool nuget:?package=Proctorio.EditorConfig&version=2.0.0
Proctorio.EditorConfig
Standardized C# code style rules for all Proctorio projects.
Install
dotnet add package Proctorio.EditorConfig
That's it. Rules apply automatically on build.
What This Enforces
Explicit types - No var. Ever.
// ❌ This will warn
var user = GetUser();
// ✅ Do this
User user = GetUser();
Private field naming - Must use underscore prefix.
// ❌ Warning
private string userName;
// ✅ Correct
private string _userName;
Readonly fields - If a field doesn't change, mark it readonly.
// ❌ Warning if never reassigned
private IUserRepository _repo;
// ✅ Better
private readonly IUserRepository _repo;
CancellationToken forwarding - Pass tokens through async calls.
// ❌ Warning
await DoWorkAsync();
// ✅ Pass it along
await DoWorkAsync(cancellationToken);
What This Suggests
These show as suggestions, not warnings:
- Use pattern matching over
as/ischecks - Use object/collection initializers
- Use null coalescing (
??) and null propagation (?.) - Use throw expressions
- Mark static members when possible
- Convert
typeof(T)tonameof(T)where valid
What This Doesn't Enforce
Ternary operators - Feel free to use them (or don't). Exception handling - CA1031 is off. Catch what you need. Null checks - CA1062 is off. Not every public method needs null guards. Localization - CA1303 is off. String literals are fine.
Formatting
Braces - Always required, even for single statements.
// ❌ No
if (condition)
DoSomething();
// ✅ Yes
if (condition)
{
DoSomething();
}
Brace style - Allman (new line).
if (condition)
{
// code
}
Indentation - 4 spaces for C#, tabs for XML/config.
Spacing
- Space after keywords:
if (x) - No space after cast:
(int)value - Space around binary operators:
x + y
Naming Conventions
| Type | Format | Example |
|---|---|---|
| Interfaces | I + PascalCase |
IUserRepository |
| Classes, Methods, Properties | PascalCase | UserService, GetUser() |
| Private fields | _camelCase |
_userName |
| Private constants | PascalCase | MaxRetries |
ConfigureAwait
The default package doesn't require .ConfigureAwait(false). If you need that, use the -RequireConfigureAwait variant (when available).
IDE Setup
Visual Studio / Rider - Works out of the box after package install.
VS Code - Install C# Dev Kit, then add the package.
Testing
This package has 34 automated tests covering rule syntax, formatting, and build integration.
dotnet test
Learn more about Target Frameworks and .NET Standard.
-
.NETStandard 2.0
- No dependencies.
NuGet packages
This package is not used by any NuGet packages.
GitHub repositories
This package is not used by any popular GitHub repositories.
v2.0.0: Universal package with comprehensive C# style rules, explicit type enforcement, modern C# patterns, and full formatting standards.