276 references to EnforceOnBuild
Microsoft.CodeAnalysis.CodeStyle (269)
src\Analyzers\Core\Analyzers\AbstractBuiltInCodeStyleDiagnosticAnalyzer.cs (2)
35
EnforceOnBuild
enforceOnBuild,
65
EnforceOnBuild
enforceOnBuild,
src\Analyzers\Core\Analyzers\AbstractBuiltInCodeStyleDiagnosticAnalyzer_Core.cs (2)
21
EnforceOnBuild
enforceOnBuild,
51
EnforceOnBuild
enforceOnBuild,
src\Analyzers\Core\Analyzers\AbstractBuiltInUnnecessaryCodeStyleDiagnosticAnalyzer.cs (2)
40
EnforceOnBuild
enforceOnBuild,
72
EnforceOnBuild
enforceOnBuild,
src\Analyzers\Core\Analyzers\AbstractCodeQualityDiagnosticAnalyzer.cs (1)
40
EnforceOnBuild
enforceOnBuild,
src\Analyzers\Core\Analyzers\DiagnosticCustomTags.cs (3)
14
private static readonly string s_enforceOnBuildNeverTag =
EnforceOnBuild
.Never.ToCustomTag();
72
internal static string[] Create(bool isUnnecessary, bool isConfigurable, bool isCustomConfigurable,
EnforceOnBuild
enforceOnBuild)
74
Debug.Assert(isConfigurable || enforceOnBuild ==
EnforceOnBuild
.Never);
src\Analyzers\Core\Analyzers\EnforceOnBuild.cs (2)
39
public static string ToCustomTag(this
EnforceOnBuild
enforceOnBuild)
40
=> $"{nameof(
EnforceOnBuild
)}_{enforceOnBuild}";
src\Analyzers\Core\Analyzers\EnforceOnBuildValues.cs (252)
12
public const
EnforceOnBuild
RemoveUnnecessaryImports = /*IDE0005*/
EnforceOnBuild
.HighlyRecommended;
13
public const
EnforceOnBuild
UseImplicitType = /*IDE0007*/
EnforceOnBuild
.HighlyRecommended;
14
public const
EnforceOnBuild
UseExplicitType = /*IDE0008*/
EnforceOnBuild
.HighlyRecommended;
15
public const
EnforceOnBuild
AddBraces = /*IDE0011*/
EnforceOnBuild
.HighlyRecommended;
16
public const
EnforceOnBuild
OrderModifiers = /*IDE0036*/
EnforceOnBuild
.HighlyRecommended;
17
public const
EnforceOnBuild
AddOrRemoveAccessibilityModifiers = /*IDE0040*/
EnforceOnBuild
.HighlyRecommended;
18
public const
EnforceOnBuild
ValidateFormatString = /*IDE0043*/
EnforceOnBuild
.HighlyRecommended;
19
public const
EnforceOnBuild
MakeFieldReadonly = /*IDE0044*/
EnforceOnBuild
.HighlyRecommended;
20
public const
EnforceOnBuild
RemoveUnusedMembers = /*IDE0051*/
EnforceOnBuild
.HighlyRecommended;
21
public const
EnforceOnBuild
RemoveUnreadMembers = /*IDE0052*/
EnforceOnBuild
.HighlyRecommended;
22
public const
EnforceOnBuild
Formatting = /*IDE0055*/
EnforceOnBuild
.HighlyRecommended;
23
public const
EnforceOnBuild
ValueAssignedIsUnused = /*IDE0059*/
EnforceOnBuild
.HighlyRecommended;
24
public const
EnforceOnBuild
UnusedParameter = /*IDE0060*/
EnforceOnBuild
.HighlyRecommended;
25
public const
EnforceOnBuild
FileHeaderMismatch = /*IDE0073*/
EnforceOnBuild
.HighlyRecommended;
26
public const
EnforceOnBuild
InvalidSuppressMessageAttribute = /*IDE0076*/
EnforceOnBuild
.HighlyRecommended;
27
public const
EnforceOnBuild
LegacyFormatSuppressMessageAttribute = /*IDE0077*/
EnforceOnBuild
.HighlyRecommended;
28
public const
EnforceOnBuild
RemoveConfusingSuppressionForIsExpression = /*IDE0080*/
EnforceOnBuild
.HighlyRecommended;
29
public const
EnforceOnBuild
UseBlockScopedNamespace = /*IDE0160*/
EnforceOnBuild
.HighlyRecommended;
30
public const
EnforceOnBuild
UseFileScopedNamespace = /*IDE0161*/
EnforceOnBuild
.HighlyRecommended;
31
public const
EnforceOnBuild
UseTupleSwap = /*IDE0180*/
EnforceOnBuild
.HighlyRecommended;
34
public const
EnforceOnBuild
UseThrowExpression = /*IDE0016*/
EnforceOnBuild
.Recommended;
35
public const
EnforceOnBuild
UseObjectInitializer = /*IDE0017*/
EnforceOnBuild
.Recommended;
36
public const
EnforceOnBuild
InlineDeclaration = /*IDE0018*/
EnforceOnBuild
.Recommended;
37
public const
EnforceOnBuild
InlineAsType = /*IDE0019*/
EnforceOnBuild
.Recommended;
38
public const
EnforceOnBuild
InlineIsType = /*IDE0020*/
EnforceOnBuild
.Recommended;
39
public const
EnforceOnBuild
UseExpressionBodyForConstructors = /*IDE0021*/
EnforceOnBuild
.Recommended;
40
public const
EnforceOnBuild
UseExpressionBodyForMethods = /*IDE0022*/
EnforceOnBuild
.Recommended;
41
public const
EnforceOnBuild
UseExpressionBodyForConversionOperators = /*IDE0023*/
EnforceOnBuild
.Recommended;
42
public const
EnforceOnBuild
UseExpressionBodyForOperators = /*IDE0024*/
EnforceOnBuild
.Recommended;
43
public const
EnforceOnBuild
UseExpressionBodyForProperties = /*IDE0025*/
EnforceOnBuild
.Recommended;
44
public const
EnforceOnBuild
UseExpressionBodyForIndexers = /*IDE0026*/
EnforceOnBuild
.Recommended;
45
public const
EnforceOnBuild
UseExpressionBodyForAccessors = /*IDE0027*/
EnforceOnBuild
.Recommended;
46
public const
EnforceOnBuild
UseCollectionInitializer = /*IDE0028*/
EnforceOnBuild
.Recommended;
47
public const
EnforceOnBuild
UseCoalesceExpression = /*IDE0029*/
EnforceOnBuild
.Recommended;
48
public const
EnforceOnBuild
UseCoalesceExpressionForNullable = /*IDE0030*/
EnforceOnBuild
.Recommended;
49
public const
EnforceOnBuild
UseNullPropagation = /*IDE0031*/
EnforceOnBuild
.Recommended;
50
public const
EnforceOnBuild
UseAutoProperty = /*IDE0032*/
EnforceOnBuild
.Recommended;
51
public const
EnforceOnBuild
UseExplicitTupleName = /*IDE0033*/
EnforceOnBuild
.Recommended;
52
public const
EnforceOnBuild
UseDefaultLiteral = /*IDE0034*/
EnforceOnBuild
.Recommended;
53
public const
EnforceOnBuild
InlineIsTypeWithoutName = /*IDE0038*/
EnforceOnBuild
.Recommended;
54
public const
EnforceOnBuild
UseLocalFunction = /*IDE0039*/
EnforceOnBuild
.Recommended;
55
public const
EnforceOnBuild
UseDeconstruction = /*IDE0042*/
EnforceOnBuild
.Recommended;
56
public const
EnforceOnBuild
UseConditionalExpressionForAssignment = /*IDE0045*/
EnforceOnBuild
.Recommended;
57
public const
EnforceOnBuild
UseConditionalExpressionForReturn = /*IDE0046*/
EnforceOnBuild
.Recommended;
58
public const
EnforceOnBuild
RemoveUnnecessaryParentheses = /*IDE0047*/
EnforceOnBuild
.Recommended;
59
public const
EnforceOnBuild
UseExpressionBodyForLambdaExpressions = /*IDE0053*/
EnforceOnBuild
.Recommended;
60
public const
EnforceOnBuild
UseCompoundAssignment = /*IDE0054*/
EnforceOnBuild
.Recommended;
61
public const
EnforceOnBuild
UseIndexOperator = /*IDE0056*/
EnforceOnBuild
.Recommended;
62
public const
EnforceOnBuild
UseRangeOperator = /*IDE0057*/
EnforceOnBuild
.Recommended;
63
public const
EnforceOnBuild
UseExpressionBodyForLocalFunctions = /*IDE0061*/
EnforceOnBuild
.Recommended;
64
public const
EnforceOnBuild
MakeLocalFunctionStatic = /*IDE0062*/
EnforceOnBuild
.Recommended;
65
public const
EnforceOnBuild
UseSimpleUsingStatement = /*IDE0063*/
EnforceOnBuild
.Recommended;
66
public const
EnforceOnBuild
MoveMisplacedUsingDirectives = /*IDE0065*/
EnforceOnBuild
.Recommended;
67
public const
EnforceOnBuild
UseSystemHashCode = /*IDE0070*/
EnforceOnBuild
.Recommended;
68
public const
EnforceOnBuild
SimplifyInterpolation = /*IDE0071*/
EnforceOnBuild
.Recommended;
69
public const
EnforceOnBuild
UseCoalesceCompoundAssignment = /*IDE0074*/
EnforceOnBuild
.Recommended;
70
public const
EnforceOnBuild
SimplifyConditionalExpression = /*IDE0075*/
EnforceOnBuild
.Recommended;
71
public const
EnforceOnBuild
UsePatternCombinators = /*IDE0078*/
EnforceOnBuild
.Recommended;
72
public const
EnforceOnBuild
RemoveUnnecessaryByVal = /*IDE0081*/
EnforceOnBuild
.Recommended;
73
public const
EnforceOnBuild
ConvertTypeOfToNameOf = /*IDE0082*/
EnforceOnBuild
.Recommended;
74
public const
EnforceOnBuild
UseNotPattern = /*IDE0083*/
EnforceOnBuild
.Recommended;
75
public const
EnforceOnBuild
UseIsNotExpression = /*IDE0084*/
EnforceOnBuild
.Recommended;
76
public const
EnforceOnBuild
UseImplicitObjectCreation = /*IDE0090*/
EnforceOnBuild
.Recommended;
77
public const
EnforceOnBuild
RemoveRedundantEquality = /*IDE0100*/
EnforceOnBuild
.Recommended;
78
public const
EnforceOnBuild
RemoveUnnecessaryDiscardDesignation = /*IDE0110*/
EnforceOnBuild
.Recommended;
79
public const
EnforceOnBuild
RemoveUnnecessaryLambdaExpression = /*IDE0200*/
EnforceOnBuild
.Recommended;
80
public const
EnforceOnBuild
InvokeDelegateWithConditionalAccess = /*IDE1005*/
EnforceOnBuild
.Recommended;
81
public const
EnforceOnBuild
NamingRule = /*IDE1006*/
EnforceOnBuild
.Recommended;
82
public const
EnforceOnBuild
MatchFolderAndNamespace = /*IDE0130*/
EnforceOnBuild
.Recommended;
83
public const
EnforceOnBuild
SimplifyObjectCreation = /*IDE0140*/
EnforceOnBuild
.Recommended;
84
public const
EnforceOnBuild
SimplifyPropertyPattern = /*IDE0170*/
EnforceOnBuild
.Recommended;
85
public const
EnforceOnBuild
RemoveRedundantNullableDirective = /*IDE0240*/
EnforceOnBuild
.Recommended;
86
public const
EnforceOnBuild
RemoveUnnecessaryNullableDirective = /*IDE0241*/
EnforceOnBuild
.Recommended;
87
public const
EnforceOnBuild
MakeStructReadOnly = /*IDE0250*/
EnforceOnBuild
.Recommended;
88
public const
EnforceOnBuild
MakeStructMemberReadOnly = /*IDE0251*/
EnforceOnBuild
.Recommended;
89
public const
EnforceOnBuild
UsePatternMatchingAsAndMemberAccess = /*IDE0260*/
EnforceOnBuild
.Recommended;
90
public const
EnforceOnBuild
UseCoalesceExpressionForIfNullCheck = /*IDE0270*/
EnforceOnBuild
.Recommended;
91
public const
EnforceOnBuild
UseNameofInAttribute = /*IDE0280*/
EnforceOnBuild
.Recommended;
92
public const
EnforceOnBuild
UsePrimaryConstructor = /*IDE0290*/
EnforceOnBuild
.Recommended;
93
public const
EnforceOnBuild
UseCollectionExpressionForArray = /*IDE0300*/
EnforceOnBuild
.Recommended;
94
public const
EnforceOnBuild
UseCollectionExpressionForEmpty = /*IDE0301*/
EnforceOnBuild
.Recommended;
95
public const
EnforceOnBuild
UseCollectionExpressionForStackAlloc = /*IDE0302*/
EnforceOnBuild
.Recommended;
96
public const
EnforceOnBuild
UseCollectionExpressionForCreate = /*IDE0303*/
EnforceOnBuild
.Recommended;
97
public const
EnforceOnBuild
UseCollectionExpressionForBuilder = /*IDE0304*/
EnforceOnBuild
.Recommended;
98
public const
EnforceOnBuild
UseCollectionExpressionForFluent = /*IDE0305*/
EnforceOnBuild
.Recommended;
99
public const
EnforceOnBuild
UseCollectionExpressionForNew = /*IDE0306*/
EnforceOnBuild
.Recommended;
100
public const
EnforceOnBuild
MakeAnonymousFunctionStatic = /*IDE0320*/
EnforceOnBuild
.Recommended;
101
public const
EnforceOnBuild
UseSystemThreadingLock = /*IDE0330*/
EnforceOnBuild
.Recommended;
102
public const
EnforceOnBuild
UseUnboundGenericTypeInNameOf = /*IDE0340*/
EnforceOnBuild
.Recommended;
103
public const
EnforceOnBuild
UseImplicitlyTypedLambdaExpression = /*IDE0350*/
EnforceOnBuild
.Recommended;
104
public const
EnforceOnBuild
SimplifyPropertyAccessor = /*IDE0360*/
EnforceOnBuild
.Recommended;
107
public const
EnforceOnBuild
RemoveUnnecessaryCast = /*IDE0004*/
EnforceOnBuild
.WhenExplicitlyEnabled; // TODO: Move to 'Recommended' OR 'HighlyRecommended' bucket once performance problems are addressed: https://github.com/dotnet/roslyn/issues/43304
108
public const
EnforceOnBuild
PopulateSwitchStatement = /*IDE0010*/
EnforceOnBuild
.WhenExplicitlyEnabled;
109
public const
EnforceOnBuild
UseInferredMemberName = /*IDE0037*/
EnforceOnBuild
.WhenExplicitlyEnabled;
110
public const
EnforceOnBuild
UseIsNullCheck = /*IDE0041*/
EnforceOnBuild
.WhenExplicitlyEnabled;
111
public const
EnforceOnBuild
AddRequiredParentheses = /*IDE0048*/
EnforceOnBuild
.WhenExplicitlyEnabled;
112
public const
EnforceOnBuild
ExpressionValueIsUnused = /*IDE0058*/
EnforceOnBuild
.WhenExplicitlyEnabled;
113
public const
EnforceOnBuild
MakeStructFieldsWritable = /*IDE0064*/
EnforceOnBuild
.WhenExplicitlyEnabled;
114
public const
EnforceOnBuild
ConvertSwitchStatementToExpression = /*IDE0066*/
EnforceOnBuild
.WhenExplicitlyEnabled;
115
public const
EnforceOnBuild
PopulateSwitchExpression = /*IDE0072*/
EnforceOnBuild
.WhenExplicitlyEnabled;
116
public const
EnforceOnBuild
SimplifyLinqExpression = /*IDE0120*/
EnforceOnBuild
.WhenExplicitlyEnabled;
117
public const
EnforceOnBuild
SimplifyLinqTypeCheckAndCast = /*IDE0121*/
EnforceOnBuild
.WhenExplicitlyEnabled;
118
public const
EnforceOnBuild
UseNullCheckOverTypeCheck = /*IDE0150*/
EnforceOnBuild
.WhenExplicitlyEnabled;
119
public const
EnforceOnBuild
UseTopLevelStatements = /*IDE0210*/
EnforceOnBuild
.WhenExplicitlyEnabled;
120
public const
EnforceOnBuild
UseProgramMain = /*IDE0211*/
EnforceOnBuild
.WhenExplicitlyEnabled;
121
public const
EnforceOnBuild
ForEachCast = /*IDE0220*/
EnforceOnBuild
.WhenExplicitlyEnabled;
122
public const
EnforceOnBuild
UseUtf8StringLiteral = /*IDE0230*/
EnforceOnBuild
.WhenExplicitlyEnabled;
123
public const
EnforceOnBuild
MultipleBlankLines = /*IDE2000*/
EnforceOnBuild
.WhenExplicitlyEnabled;
124
public const
EnforceOnBuild
EmbeddedStatementPlacement = /*IDE2001*/
EnforceOnBuild
.WhenExplicitlyEnabled;
125
public const
EnforceOnBuild
ConsecutiveBracePlacement = /*IDE2002*/
EnforceOnBuild
.WhenExplicitlyEnabled;
126
public const
EnforceOnBuild
ConsecutiveStatementPlacement = /*IDE2003*/
EnforceOnBuild
.WhenExplicitlyEnabled;
127
public const
EnforceOnBuild
ConstructorInitializerPlacement = /*IDE2004*/
EnforceOnBuild
.WhenExplicitlyEnabled;
128
public const
EnforceOnBuild
ConditionalExpressionPlacement = /*IDE2005*/
EnforceOnBuild
.WhenExplicitlyEnabled;
129
public const
EnforceOnBuild
ArrowExpressionClausePlacement = /*IDE2006*/
EnforceOnBuild
.WhenExplicitlyEnabled;
131
public const
EnforceOnBuild
Regex = /*RE0001*/
EnforceOnBuild
.WhenExplicitlyEnabled;
132
public const
EnforceOnBuild
Json = /*JSON001*/
EnforceOnBuild
.WhenExplicitlyEnabled;
136
public const
EnforceOnBuild
SimplifyNames = /*IDE0001*/
EnforceOnBuild
.Never;
137
public const
EnforceOnBuild
SimplifyMemberAccess = /*IDE0002*/
EnforceOnBuild
.Never;
138
public const
EnforceOnBuild
RemoveQualification = /*IDE0003*/
EnforceOnBuild
.Never;
139
public const
EnforceOnBuild
AddQualification = /*IDE0009*/
EnforceOnBuild
.Never;
140
public const
EnforceOnBuild
PreferBuiltInOrFrameworkType = /*IDE0049*/
EnforceOnBuild
.Never;
141
public const
EnforceOnBuild
ConvertAnonymousTypeToTuple = /*IDE0050*/
EnforceOnBuild
.Never;
142
public const
EnforceOnBuild
RemoveUnreachableCode = /*IDE0035*/
EnforceOnBuild
.Never; // Non-configurable fading diagnostic corresponding to CS0162.
143
public const
EnforceOnBuild
RemoveUnnecessarySuppression = /*IDE0079*/
EnforceOnBuild
.Never; // IDE-only analyzer.
144
public const
EnforceOnBuild
CopilotImplementNotImplementedException = /*IDE3000*/
EnforceOnBuild
.Never; // IDE-only analyzer.
147
public const
EnforceOnBuild
DetectProbableJsonStrings = /*JSON002*/
EnforceOnBuild
.Never;
src\Analyzers\Core\Analyzers\PopulateSwitch\AbstractPopulateSwitchDiagnosticAnalyzer.cs (1)
15
EnforceOnBuild
enforceOnBuild)
src\Analyzers\Core\Analyzers\RemoveUnnecessaryImports\AbstractRemoveUnnecessaryImportsDiagnosticAnalyzer.cs (3)
31
RemoveUnnecessaryImportsConstants.DiagnosticFixableId,
EnforceOnBuild
.Never, hasAnyCodeStyleOption: false, "", "", isConfigurable: false);
43
customTags: [.. DiagnosticCustomTags.Microsoft,
EnforceOnBuild
.Never.ToCustomTag()]);
59
generatedCodeClassificationIdDescriptor = CreateDescriptorWithId(IDEDiagnosticIds.RemoveUnnecessaryImportsDiagnosticId + "_gen",
EnforceOnBuild
.Never, hasAnyCodeStyleOption: false, titleAndMessage, isUnnecessary: true, isConfigurable: false);
src\Analyzers\Core\Analyzers\UseConditionalExpression\AbstractUseConditionalExpressionDiagnosticAnalyzer.cs (1)
16
EnforceOnBuild
enforceOnBuild,
Microsoft.CodeAnalysis.CSharp.CodeStyle (6)
src\Analyzers\CSharp\Analyzers\UseCollectionExpression\AbstractCSharpUseCollectionExpressionDiagnosticAnalyzer.cs (2)
25
protected AbstractCSharpUseCollectionExpressionDiagnosticAnalyzer(string diagnosticId,
EnforceOnBuild
enforceOnBuild)
34
private static DiagnosticDescriptor CreateDescriptor(string diagnosticId,
EnforceOnBuild
enforceOnBuild, bool isUnnecessary)
src\Analyzers\CSharp\Analyzers\UseExpressionBody\Helpers\UseExpressionBodyHelper.cs (1)
21
public abstract
EnforceOnBuild
EnforceOnBuild { get; }
src\Analyzers\CSharp\Analyzers\UseExpressionBody\Helpers\UseExpressionBodyHelper`1.cs (2)
34
public override
EnforceOnBuild
EnforceOnBuild { get; }
39
EnforceOnBuild
enforceOnBuild,
src\Analyzers\CSharp\Analyzers\UseImplicitOrExplicitType\CSharpTypeStyleDiagnosticAnalyzerBase.cs (1)
16
EnforceOnBuild
enforceOnBuild,
Microsoft.CodeAnalysis.CSharp.CodeStyle.UnitTests (1)
src\Analyzers\CSharp\Tests\AbstractBuiltInCodeStyleDiagnosticAnalyzer\AbstractBuiltInCodeStyleDiagnosticAnalyzerTests.cs (1)
42
enforceOnBuild:
EnforceOnBuild
.Never,