应用 adotnet_naming_rule
不会通过 触发警告dotnet format
。
# Remove the line below if you want to inherit .editorconfig settings from higher directories
root = true
#### Naming rules ####
# https://docs.microsoft.com/en-us/dotnet/fundamentals/code-analysis/style-rules/naming-rules
dotnet_diagnostic.IDE1006.severity = error
# Types should be PascalCase
dotnet_naming_rule.types_should_be_pascal_case.severity = error
dotnet_naming_rule.types_should_be_pascal_case.symbols = type_symbols
dotnet_naming_rule.types_should_be_pascal_case.style = pascal_case
dotnet_naming_symbols.type_symbols.applicable_kinds = class
dotnet_naming_symbols.type_symbols.applicable_accessibilities = *
dotnet_naming_style.pascal_case.capitalization = pascal_case
using System;
using System.Threading.Tasks;
namespace EditorConfig
{
public interface barFoo
{
}
class Footype_Cymbolsar : barFoo
{
private readonly int ValueZero = 0;
private readonly int ValueOne = 1;
public int GetValue()
{
return ValueOne + ValueZero;
}
public Task<int> GetValues()
{
return Task.FromResult(GetValue());
}
}
}
我预计Footype_Cymbolsar
在运行时会触发错误dotnet format EditorConfig --fix-style info --check
;它不是。