CodeAnalysisRuleSettings CodeAnalysisRuleSettings 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
CodeAnalysisRuleSettingsCodeAnalysisRuleSettingsCodeAnalysisRuleSettings
Implements

Constructors

CodeAnalysisRuleSettings() CodeAnalysisRuleSettings() CodeAnalysisRuleSettings()

Creates a new CodeAnalysisRuleSettings object.

CodeAnalysisRuleSettings(IEnumerable<RuleConfiguration>) CodeAnalysisRuleSettings(IEnumerable<RuleConfiguration>) CodeAnalysisRuleSettings(IEnumerable<RuleConfiguration>)

Creates a new CodeAnalysisRuleSettings containing a set of rules.

Properties

DisableRulesNotInSettings DisableRulesNotInSettings 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) Add(RuleConfiguration) Add(RuleConfiguration)

Adds a new RuleConfiguration object to the list of rules

ApplySettingsToRules(IEnumerable<RuleConfiguration>) ApplySettingsToRules(IEnumerable<RuleConfiguration>) ApplySettingsToRules(IEnumerable<RuleConfiguration>)

Applies these settings to another set of rules.

ConvertToSettingsString() ConvertToSettingsString() 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>) CreateFromSettingsString(String, IList<ExtensibilityError>) 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) DisableRule(String) DisableRule(String)

Excludes a rule from execution

EnableRule(String) EnableRule(String) EnableRule(String)

Includes a rule for execution

FindConfiguration(String) FindConfiguration(String) 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() GetEnumerator()

GetEnumerator()

IsRuleDisabled(String) IsRuleDisabled(String) IsRuleDisabled(String)

Is a particular rule in the rule settings disabled?

IsRuleProblemTreatedAsError(String) IsRuleProblemTreatedAsError(String) IsRuleProblemTreatedAsError(String)

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

Remove(RuleConfiguration) Remove(RuleConfiguration) Remove(RuleConfiguration)

Removes a RuleConfiguration object from the list of rules.

TreatRuleProblemAsError(String) TreatRuleProblemAsError(String) TreatRuleProblemAsError(String)

Treat any problems found a rule as errors

TreatRuleProblemAsWarning(String) TreatRuleProblemAsWarning(String) TreatRuleProblemAsWarning(String)

Treat any problems found a rule as warnings

TryGetRuleConfiguration(String, RuleConfiguration) TryGetRuleConfiguration(String, RuleConfiguration) TryGetRuleConfiguration(String, RuleConfiguration)

Tries to find the RuleConfiguration that matches the specified ruleId.

Explicit Interface Implementations

IEnumerable.GetEnumerator() IEnumerable.GetEnumerator() IEnumerable.GetEnumerator()

Applies to