Skip to content
New issue

Have a question about this project? Sign up for a free GitHub account to open an issue and contact its maintainers and the community.

By clicking “Sign up for GitHub”, you agree to our terms of service and privacy statement. We’ll occasionally send you account related emails.

Already on GitHub? Sign in to your account

If multiple rules are matching, they are applied in alphabetical order and not "most recent" #377

Open
1 task done
sevenk opened this issue Dec 21, 2024 · 0 comments
Open
1 task done

Comments

@sevenk
Copy link

sevenk commented Dec 21, 2024

Please fill-in this template.

Issue

Visual Studio Code editorconfig-vscode
Version 1.96.2 0.16.4

Root .editorconfig File

Top-most EditorConfig file.

root = true

All files

[*]
charset = utf-8

indent_size intentionally not specified in this section.

indent_style = tab # Use soft tabs (spaces) for indentation.
insert_final_newline = true
trim_trailing_whitespace = true

Naming styles

dotnet_naming_style.pascal_case_style.capitalization = pascal_case

Symbol specifications

dotnet_naming_symbols.all_members_symbol.applicable_kinds = *

dotnet_naming_rule.a.symbols = all_members_symbol
dotnet_naming_rule.a.style = pascal_case_style
dotnet_naming_rule.a.severity = error

dotnet_naming_rule.b.symbols = all_members_symbol
dotnet_naming_rule.b.style = pascal_case_style
dotnet_naming_rule.b.severity = warning

Are there any other relevant .editorconfig files in your project? No

File opened

./foo.cs

public static class Stuff
{
private static readonly int _XdataFile = 0;
}

Expected behavior

_XdataFile is marked with a warning.
It is not in pascal_case and rule b is the last defined.

Actual behavior

_XdataFile is marked with an error.

Additional comments or steps to reproduce

From all the matching rules, the rule with the lowest name (rule a has precedence over b) is applied.
In this example, a < b: rule a is applied.
If rule a is renamed to c, b < c: rule b is applied.
The order of defining does not matter, but it should.

Sign up for free to join this conversation on GitHub. Already have an account? Sign in to comment
Labels
None yet
Projects
None yet
Development

No branches or pull requests

1 participant