directive-keyword-space
What it does
Section titled “What it does”Reports a preprocessor directive that has a space between # and its keyword (# if). The fix removes the space.
Why it matters
Section titled “Why it matters”The convention writes the directive as one word, #if, #region, so a search for it finds all of them and the directives look alike.
Example
Section titled “Example”class A {# region R int a;# endregion# if X int b;#endif}class A {#region R int a;#endregion#if X int b;#endif}Configuration
Section titled “Configuration”csharp: lint: rules: directive-keyword-space: warn # off (default), warn, errorEnabled by the presets: csharp/stylecop.
Suppress one line with sudsy-disable-next-line directive-keyword-space 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 | SA1006 |
full |