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