separate-attributes
What it does
Section titled “What it does”Reports an attribute list with several attributes: [A, B] is [A] and [B]. Lists on parameters and type parameters are not reported. The fix is not offered when the list has a comment in it.
Why it matters
Section titled “Why it matters”One attribute to a list gives each its own line, so a diff shows exactly the attribute that was added or removed and a comment can be put on one.
Example
Section titled “Example”[assembly: A, B]class C { [A(), B] void F([A, B] int p) { } [A, // why B] int x;...}Configuration
Section titled “Configuration”csharp: lint: rules: separate-attributes: warn # off (default), warn, errorEnabled by the presets: csharp/stylecop.
Suppress one line with sudsy-disable-next-line separate-attributes in a comment of the file’s language.
Upstream equivalents
Section titled “Upstream equivalents”The same check in other tools; Sudsy reports what each upstream rule reports.
| Tool | Rule | Match |
|---|---|---|
| StyleCop | SA1133 |
full |