为什么我的 editorconfig 没有抛出命名错误?

问题描述

应用 dotnet_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 时触发错误;没有。

解决方法

暂无找到可以解决该程序问题的有效方法,小编努力寻找整理中!

如果你已经找到好的解决方法,欢迎将解决方案带上本链接一起发送给小编。

小编邮箱:dio#foxmail.com (将#修改为@)