SA1014.md
December 2, 2025 ยท View on GitHub
SA1014
| TypeName | SA1014OpeningGenericBracketsMustBeSpacedCorrectly |
| CheckId | SA1014 |
| Category | Spacing Rules |
Cause
An opening generic bracket within a C# element is not spaced correctly.
Rule description
A violation of this rule occurs when the spacing around an opening generic bracket is not correct.
An opening generic bracket should never be preceded or followed by whitespace, unless the bracket is the first or last character on the line.
The same spacing applies to the < that starts a C# 9 function pointer parameter list, as in delegate*<int, void>.
How to fix violations
To fix a violation of this rule, ensure that there is no whitespace on either side of the opening generic bracket.
How to suppress violations
[SuppressMessage("StyleCop.CSharp.SpacingRules", "SA1014:OpeningGenericBracketsMustBeSpacedCorrectly", Justification = "Reviewed.")]
#pragma warning disable SA1014 // OpeningGenericBracketsMustBeSpacedCorrectly
#pragma warning restore SA1014 // OpeningGenericBracketsMustBeSpacedCorrectly