-
Notifications
You must be signed in to change notification settings - Fork 22
SA1029
Christophe HEISER edited this page Sep 26, 2015
·
2 revisions
<script src="script/helpstudio.js" type="text/javascript"></script>
<script src="script/StandardText.js" type="text/jscript"></script>
<script type="text/jscript">WritePageTop(document.title);</script>
TypeName |
DoNotSplitNullConditionalOperators |
CheckId |
SA1029 |
Category |
Spacing Rules |
The null conditional symbol is separated by a character.
```csharp // Allowed foo?.Bar();// Not allowed foo? .Bar();
// Not allowed foo? // comment .Bar();
// Allowed foo?[index];
// Not allowed foo? [index];
// Not allowed foo? // comment [index];
<H2>Rule Description</H2>
<P>A violation of this rule occurs whenever the null conditional symbol ('?.' or '?[') is separated by a new row, space or comment.</P>
<H2>How to Fix Violations</H2>
<P>To fix a violation of this rule, remove all characters between the null conditional symbol.</P>
<h2>How to Suppress Violations</h2>
<pre>[SuppressMessage("StyleCop.CSharp.SpacingRules", "SA1029:DoNotSplitNullConditionalOperators", Justification = "Reviewed.")]</pre>
</div></div>
</body>
</html>
- - SA0102 - Clean Install
- - Download
- - Documentation Rules - Layout Rules - Maintainability Rules - Naming Rules - Ordering Rules - Readability Rules - Spacing Rules - Suppressions
- - Adding a custom StyleCop settings page - Adding custom rule settings - Authoring a custom styleCop rule - Authoring rules metadata - Custom CSharp Language Service - Custom MSBuild Integration - Hosting StyleCop in a Custom Environment - Installing a Custom Rule - Integrating StyleCop Into Build Environments - Integrating StyleCop into MSBuild - Writing Custom Rules for StyleCop