-
Notifications
You must be signed in to change notification settings - Fork 0
Variables
Actionbot edited this page Apr 11, 2026
·
1 revision
Extract duplicate strings (e.g., file paths) into reusable variables.
.editorconfig-main
^biak^ var excludedFiles = "TestFile1.cs,TestFile2.cs";
# StyleCop.Analyzers rules
[*.cs]
dotnet_diagnostic.SA1025.severity = error
dotnet_diagnostic.SA1026.severity = error
dotnet_diagnostic.SA1028.severity = error
[{$excludedFiles}]
dotnet_diagnostic.SA1025.severity = none
dotnet_diagnostic.SA1026.severity = none
dotnet_diagnostic.SA1028.severity = none
# Code analysis (CAxxxx) rules
[*.cs]
dotnet_diagnostic.CA1724.severity = error
dotnet_diagnostic.CA1727.severity = error
dotnet_diagnostic.CA1716.severity = error
[{$excludedFiles}]
dotnet_diagnostic.CA1724.severity = none
dotnet_diagnostic.CA1727.severity = none
dotnet_diagnostic.CA1716.severity = none
...After running the Enable / Disable commands, the .editorconfig file is converted to:
# StyleCop.Analyzers rules
[*.cs]
dotnet_diagnostic.SA1025.severity = error
dotnet_diagnostic.SA1026.severity = error
dotnet_diagnostic.SA1028.severity = error
[{TestFile1.cs,TestFile2.cs}]
dotnet_diagnostic.SA1025.severity = none
dotnet_diagnostic.SA1026.severity = none
dotnet_diagnostic.SA1028.severity = none
# Code analysis (CAxxxx) rules
[*.cs]
dotnet_diagnostic.CA1724.severity = error
dotnet_diagnostic.CA1727.severity = error
dotnet_diagnostic.CA1716.severity = error
[{TestFile1.cs,TestFile2.cs}]
dotnet_diagnostic.CA1724.severity = none
dotnet_diagnostic.CA1727.severity = none
dotnet_diagnostic.CA1716.severity = none
...As you can see, $excludedFiles is replaced with TestFile1.cs,TestFile2.cs.
- Can only be defined within
.editorconfig-main - Supports concatenation of strings using line breaks
^biak^ var excludedFiles = "TestFile1.cs" + ",TestFile2.cs" + ",TestFile3.cs" ;
Hey! If you don't have write access to the wiki, you can change that in the docs/wiki folder.