Partager via


CodeAnalysisRuleSettings Class

Definition

The settings used to configure rules used during analysis.

Before analysis begins, this settings object will be applied to the rules discovered by the analysis service. If DisableRulesNotInSettings is set to true then any rules not included in these settings will be disabled and not run during analysis.

These settings are applied by calling the ApplySettingsToRules(IEnumerable<RuleConfiguration>) method on rules returned by the engine.

public sealed class CodeAnalysisRuleSettings : System.Collections.Generic.IEnumerable<Microsoft.SqlServer.Dac.CodeAnalysis.RuleConfiguration>
type CodeAnalysisRuleSettings = class
    interface seq<RuleConfiguration>
    interface IEnumerable
Public NotInheritable Class CodeAnalysisRuleSettings
Implements IEnumerable(Of RuleConfiguration)
Inheritance
CodeAnalysisRuleSettings
Implements

Constructors

CodeAnalysisRuleSettings()

Creates a new CodeAnalysisRuleSettings object.

CodeAnalysisRuleSettings(IEnumerable<RuleConfiguration>)

Creates a new CodeAnalysisRuleSettings containing a set of rules.

Properties

DisableRulesNotInSettings

Should rules not found in these settings be disabled? The default is "false", so that any rules not explicitly covered in the settings will still be run during analysis.

Methods

Add(RuleConfiguration)

Adds a new RuleConfiguration object to the list of rules

ApplySettingsToRules(IEnumerable<RuleConfiguration>)

Applies these settings to another set of rules.

ConvertToSettingsString()

Converts the rule configuration info in this CodeAnalysisRuleSettings object into a settings string like the one used inside SSDT project files. This string defines what rules should be disabled or have their problems treated as errors instead of warnings. Any rule not included in the settings string will be enabled by default.

CreateFromSettingsString(String, IList<ExtensibilityError>)

Creates a CodeAnalysisRuleSettings configuration based on a settings string like the one used inside SSDT project files. This string defines what rules should be disabled or have their problems treated as errors instead of warnings. Any rule not included in the settings string will be enabled by default.

DisableRule(String)

Excludes a rule from execution

EnableRule(String)

Includes a rule for execution

FindConfiguration(String)

Tries to find the RuleConfiguration that matches the specified ruleId. If the configuration doesn't exist then null will be returned

GetEnumerator()

GetEnumerator()

IsRuleDisabled(String)

Is a particular rule in the rule settings disabled?

IsRuleProblemTreatedAsError(String)

Is a particular rule in the rule settings treated as error?

Remove(RuleConfiguration)

Removes a RuleConfiguration object from the list of rules.

TreatRuleProblemAsError(String)

Treat any problems found a rule as errors

TreatRuleProblemAsWarning(String)

Treat any problems found a rule as warnings

TryGetRuleConfiguration(String, RuleConfiguration)

Tries to find the RuleConfiguration that matches the specified ruleId.

Explicit Interface Implementations

IEnumerable.GetEnumerator()

Applies to