Config¶
mcp_zen_of_languages.config
¶
Configuration discovery, YAML loading, and pipeline override merging.
Every zen analysis session begins here. This module owns the lifecycle of
zen-config.yaml—from locating the file on disk, through YAML parsing,
to Pydantic-validated ConfigModel construction with fully resolved
detector pipelines.
Discovery algorithm
When no explicit path is supplied, the loader walks the filesystem
upward from the current working directory, inspecting each directory
for zen-config.yaml. The walk stops at the first directory that
contains a pyproject.toml (the project-root marker), even when no
config file has been found yet. This prevents accidental reads from
unrelated parent projects.
Merge semantics
User-supplied YAML keys are shallow-merged over built-in defaults so
that a minimal config (e.g. just severity_threshold: 3) inherits
every other default without the author having to repeat them.
Pipeline generation
If the resolved config contains no pipelines section, the loader
auto-generates one pipeline per declared language by projecting
zen-principle rules through
PipelineConfig.from_rules.
See Also
PipelineConfig: Per-language detector pipeline model.
merge_pipeline_overrides: Merges user overrides into rule-derived
base pipelines by detector type.
Classes¶
ConfigModel
¶
Bases: BaseModel
Root Pydantic model that holds every tunable knob for zen analysis.
ConfigModel is the single source of truth produced by load_config.
Analyzers, the MCP server, and the CLI all receive a validated instance of
this model—never a raw dictionary—so typos in YAML keys surface as
ValidationError rather than silent mis-configuration.
| ATTRIBUTE | DESCRIPTION |
|---|---|
languages |
Ordered list of language identifiers that the analysis
session will support. Defaults to ten built-in languages
(python, ruby, typescript, javascript, go, rust, bash,
powershell, cpp, csharp). Adding an entry here causes
TYPE:
|
severity_threshold |
Minimum severity score (1-10) a violation must
reach to be included in analysis results. Violations below
this threshold are silently dropped. Default is
TYPE:
|
pipelines |
Per-language detector pipeline configurations. Each
entry pairs a language identifier with a list of
TYPE:
|
Example YAML mapping::
languages:
- python
- typescript
severity_threshold: 3
pipelines:
- language: python
detectors:
- type: cyclomatic_complexity
max_cyclomatic_complexity: 8
Note
model_config = ConfigDict(extra="forbid") rejects unknown keys,
turning YAML typos like severitythreshold into immediate
validation errors instead of silently ignored fields.
See Also
PipelineConfig: Schema for individual pipeline entries.
load_config: Factory that discovers, parses, merges, and
validates YAML into a ConfigModel instance.
Functions¶
pipeline_for
¶
Resolve the effective detector pipeline for a single language.
Resolution follows a two-layer strategy:
- Base layer —
PipelineConfig.from_rules(language)projects the language's zen principles into detector configs, producing a pipeline whose thresholds mirror the canonical rules. - Override layer — if the user's
pipelineslist contains an entry whoselanguagefield matches, its detectors are merged on top of the base layer by detectortypeviamerge_pipeline_overrides. Detectors present only in the base are kept unchanged; detectors present only in the override are appended.
When no matching override exists the base pipeline is returned unmodified, ensuring every supported language always gets a complete detector configuration even with a minimal YAML file.
| PARAMETER | DESCRIPTION |
|---|---|
language
|
Case-sensitive language identifier (e.g.
TYPE:
|
| RETURNS | DESCRIPTION |
|---|---|
PipelineConfig
|
Fully resolved
TYPE:
|
PipelineConfig
|
detectors and any user overrides merged in. |
See Also
PipelineConfig.from_rules: Builds the base pipeline from
zen principles.
merge_pipeline_overrides: Performs the per-detector-type
merge of base and override configs.
Source code in src/mcp_zen_of_languages/config.py
Functions¶
load_config
¶
Discover, load, and validate zen-config.yaml into a ConfigModel.
The discovery algorithm searches for zen-config.yaml using a
deterministic walk that balances convenience with safety:
- Explicit path — when path is supplied the file is read directly; no filesystem walk occurs.
- CWD check —
Path.cwd() / "zen-config.yaml"is tried first. - Upward walk — each parent directory is inspected in order.
The walk halts as soon as a directory containing
pyproject.tomlis reached (the project-root marker), even if no config was found, preventing accidental reads from unrelated ancestor projects.
Once a file is located the raw YAML is shallow-merged over the
built-in defaults (ConfigModel()), so a minimal file that sets
only severity_threshold: 3 inherits every other default without
repetition.
If the merged config has an empty pipelines list, a pipeline is
auto-generated for each language in languages by calling
PipelineConfig.from_rules, guaranteeing that every declared
language ships with a complete detector configuration.
| PARAMETER | DESCRIPTION |
|---|---|
path
|
Filesystem path to
TYPE:
|
| RETURNS | DESCRIPTION |
|---|---|
ConfigModel
|
Validated
TYPE:
|
ConfigModel
|
configuration. Returns a default |
ConfigModel
|
file is found anywhere on the search path. |
| RAISES | DESCRIPTION |
|---|---|
yaml.YAMLError
|
If the file contains invalid YAML syntax. |
ValidationError
|
If merged values violate |
Examples:
Explicit path::
cfg = load_config("/repo/zen-config.yaml")
Auto-discovery from CWD::
cfg = load_config() # walks CWD → parents → pyproject.toml
See Also
ConfigModel: The Pydantic model returned by this function.
PipelineConfig.from_rules: Generates pipelines when
pipelines is empty.
Source code in src/mcp_zen_of_languages/config.py
195 196 197 198 199 200 201 202 203 204 205 206 207 208 209 210 211 212 213 214 215 216 217 218 219 220 221 222 223 224 225 226 227 228 229 230 231 232 233 234 235 236 237 238 239 240 241 242 243 244 245 246 247 248 249 250 251 252 253 254 255 256 257 258 259 260 261 262 263 264 265 266 267 268 269 270 271 272 273 274 275 276 277 278 279 280 281 282 283 284 285 286 287 288 289 290 291 292 293 294 295 296 | |
mcp_zen_of_languages.languages.configs
¶
Pydantic configuration models for violation detectors across all supported languages.
Each model inherits from DetectorConfig and adds fields specific to a
single detector type. The type literal acts as a discriminator so the
pipeline can deserialize heterogeneous detector configurations from
zen-config.yaml into the correct Pydantic class.
See Also
mcp_zen_of_languages.analyzers.pipeline: Merges these configs with
rule-derived defaults at analysis time.
Classes¶
RuleContext
¶
Bases: BaseModel
Rule-scoped metadata preserved for composite detectors.
Composite detectors may cover several rule ids while sharing one detector implementation and one config type. This model keeps the original principle-specific metadata so detectors can render the correct rule label, severity, and default violation messages at emission time.
DetectorConfig
¶
Bases: BaseModel
Base configuration shared by every violation detector.
Subclasses add detector-specific fields while inheriting common metadata
like principle_id, severity, and violation_messages.
| ATTRIBUTE | DESCRIPTION |
|---|---|
type |
Discriminator string that uniquely identifies the detector kind.
TYPE:
|
principle_id |
Optional zen principle identifier this detector enforces.
TYPE:
|
principle |
Human-readable name of the zen principle, used as a fallback violation message when no specific messages are configured.
TYPE:
|
severity |
Violation severity on a 1-10 scale (1 = informational, 10 = critical).
TYPE:
|
violation_messages |
Ordered list of message templates; the first matching template is selected at report time.
TYPE:
|
detectable_patterns |
Literal strings or
TYPE:
|
recommended_alternative |
Suggestion text appended to violation reports when a better practice exists.
TYPE:
|
rule_contexts |
Rule-specific metadata map used by composite detectors to emit precise principle labels and severities.
TYPE:
|
Functions¶
select_violation_message
¶
Choose a violation message by substring match or positional index.
When contains is given, the first message whose text includes that substring is returned. Otherwise the message at index is used, falling back to the first message, the principle name, or the type discriminator if no messages are configured.
| PARAMETER | DESCRIPTION |
|---|---|
contains
|
Optional substring to match against available messages. Default to None.
TYPE:
|
index
|
Zero-based position selecting a message when no substring match is requested. Default to 0.
TYPE:
|
rule_id
|
Optional rule identifier for composite detectors. When provided and available, message selection uses that rule's preserved context. Default to None.
TYPE:
|
| RETURNS | DESCRIPTION |
|---|---|
str
|
The selected violation message text.
TYPE:
|
Source code in src/mcp_zen_of_languages/languages/configs.py
rule_context
¶
Return preserved metadata for one rule when available.
Source code in src/mcp_zen_of_languages/languages/configs.py
principle_for_rule
¶
Resolve the human-readable principle name for one rule.
Source code in src/mcp_zen_of_languages/languages/configs.py
severity_for_rule
¶
Resolve the severity for one rule with sensible fallback behavior.
Source code in src/mcp_zen_of_languages/languages/configs.py
linked_dogma_ids_for_rule
¶
Resolve authored linked dogma ids for one rule.
Source code in src/mcp_zen_of_languages/languages/configs.py
verified_dogma_ids_for_rule
¶
Resolve authored verified dogma ids for one rule.
Source code in src/mcp_zen_of_languages/languages/configs.py
linked_testing_ids_for_rule
¶
Resolve authored linked testing-family ids for one rule.
Source code in src/mcp_zen_of_languages/languages/configs.py
verified_testing_ids_for_rule
¶
Resolve authored verified testing-family ids for one rule.
Source code in src/mcp_zen_of_languages/languages/configs.py
NameStyleConfig
¶
Bases: DetectorConfig
Naming convention enforcement settings.
| ATTRIBUTE | DESCRIPTION |
|---|---|
naming_convention |
Expected convention pattern (e.g.
TYPE:
|
min_identifier_length |
Shortest acceptable identifier length.
TYPE:
|
SparseCodeConfig
¶
Bases: DetectorConfig
Code density and whitespace separation settings.
| ATTRIBUTE | DESCRIPTION |
|---|---|
max_statements_per_line |
Maximum statements allowed on a single line.
TYPE:
|
min_blank_lines_between_defs |
Minimum blank lines required between top-level definitions.
TYPE:
|
ConsistencyConfig
¶
Bases: DetectorConfig
Naming-style consistency settings across a codebase.
| ATTRIBUTE | DESCRIPTION |
|---|---|
max_naming_styles |
Maximum distinct naming conventions allowed.
TYPE:
|
ExplicitnessConfig
¶
Bases: DetectorConfig
Explicit type annotation enforcement settings.
| ATTRIBUTE | DESCRIPTION |
|---|---|
require_type_hints |
When
TYPE:
|
NamespaceConfig
¶
Bases: DetectorConfig
Namespace and top-level symbol density settings.
| ATTRIBUTE | DESCRIPTION |
|---|---|
max_top_level_symbols |
Maximum top-level names before flagging pollution.
TYPE:
|
max_exports |
Maximum public exports allowed from a module.
TYPE:
|
CyclomaticComplexityConfig
¶
Bases: DetectorConfig
Cyclomatic complexity threshold settings.
| ATTRIBUTE | DESCRIPTION |
|---|---|
max_cyclomatic_complexity |
Upper bound on per-function cyclomatic complexity.
TYPE:
|
NestingDepthConfig
¶
Bases: DetectorConfig
Control-flow nesting depth threshold settings.
| ATTRIBUTE | DESCRIPTION |
|---|---|
max_nesting_depth |
Maximum allowed indentation levels within a function.
TYPE:
|
LongFunctionConfig
¶
Bases: DetectorConfig
Function length threshold settings.
| ATTRIBUTE | DESCRIPTION |
|---|---|
max_function_length |
Maximum lines allowed in a single function body.
TYPE:
|
GodClassConfig
¶
Bases: DetectorConfig
God-class detection threshold settings.
| ATTRIBUTE | DESCRIPTION |
|---|---|
max_methods |
Maximum methods per class before flagging.
TYPE:
|
max_class_length |
Maximum total lines in a class definition.
TYPE:
|
MagicMethodConfig
¶
Bases: DetectorConfig
Magic/dunder method count threshold settings.
| ATTRIBUTE | DESCRIPTION |
|---|---|
max_magic_methods |
Maximum dunder methods per class.
TYPE:
|
CircularDependencyConfig
¶
DeepInheritanceConfig
¶
Bases: DetectorConfig
Inheritance chain depth threshold settings.
| ATTRIBUTE | DESCRIPTION |
|---|---|
max_depth |
Maximum allowed inheritance levels.
TYPE:
|
FeatureEnvyConfig
¶
Bases: DetectorConfig
Feature envy detection settings.
| ATTRIBUTE | DESCRIPTION |
|---|---|
min_occurrences |
Minimum external attribute accesses to trigger a violation.
TYPE:
|
DuplicateImplementationConfig
¶
ClassSizeConfig
¶
Bases: DetectorConfig
Class size threshold settings.
| ATTRIBUTE | DESCRIPTION |
|---|---|
max_class_length |
Maximum total lines in a class definition.
TYPE:
|
LineLengthConfig
¶
Bases: DetectorConfig
Line length threshold settings.
| ATTRIBUTE | DESCRIPTION |
|---|---|
max_line_length |
Maximum characters per source line.
TYPE:
|
DocstringConfig
¶
ContextManagerConfig
¶
StarImportConfig
¶
BareExceptConfig
¶
MagicNumberConfig
¶
Bases: DetectorConfig
Magic number literal detection settings.
| ATTRIBUTE | DESCRIPTION |
|---|---|
max_magic_numbers |
Maximum unnamed numeric literals allowed.
TYPE:
|
ComplexOneLinersConfig
¶
Bases: DetectorConfig
Complex one-liner comprehension detection settings.
| ATTRIBUTE | DESCRIPTION |
|---|---|
max_for_clauses |
Maximum
TYPE:
|
max_line_length |
Maximum line length for a comprehension expression.
TYPE:
|
ShortVariableNamesConfig
¶
Bases: DetectorConfig
Short variable name detection settings.
| ATTRIBUTE | DESCRIPTION |
|---|---|
min_identifier_length |
Minimum characters for a variable name.
TYPE:
|
allowed_loop_names |
Names exempted from the length check (e.g., loop counters).
TYPE:
|
TsAnyUsageConfig
¶
Bases: DetectorConfig
TypeScript any usage detection settings.
| ATTRIBUTE | DESCRIPTION |
|---|---|
max_any_usages |
Maximum permitted
TYPE:
|
detect_explicit_any |
Flag explicit
TYPE:
|
detect_assertions_any |
Flag
TYPE:
|
detect_any_arrays |
Flag
TYPE:
|
TsStrictModeConfig
¶
Bases: DetectorConfig
TypeScript strict-mode compiler flag enforcement settings.
| ATTRIBUTE | DESCRIPTION |
|---|---|
require_strict |
Require the
TYPE:
|
require_no_implicit_any |
Require
TYPE:
|
require_strict_null_checks |
Require
TYPE:
|
TsInterfacePreferenceConfig
¶
Bases: DetectorConfig
TypeScript interface-over-type-alias preference settings.
| ATTRIBUTE | DESCRIPTION |
|---|---|
max_object_type_aliases |
Maximum object-shape type aliases before a violation.
TYPE:
|
TsReturnTypeConfig
¶
Bases: DetectorConfig
TypeScript explicit return-type annotation enforcement settings.
| ATTRIBUTE | DESCRIPTION |
|---|---|
require_return_types |
When
TYPE:
|
TsReadonlyConfig
¶
Bases: DetectorConfig
TypeScript readonly modifier enforcement settings.
| ATTRIBUTE | DESCRIPTION |
|---|---|
require_readonly_properties |
Require
TYPE:
|
min_readonly_occurrences |
Minimum expected
TYPE:
|
TsTypeGuardConfig
¶
Bases: DetectorConfig
TypeScript type-guard preference over type-assertion settings.
| ATTRIBUTE | DESCRIPTION |
|---|---|
max_type_assertions |
Maximum
TYPE:
|
TsUtilityTypesConfig
¶
Bases: DetectorConfig
TypeScript built-in utility-type usage enforcement settings.
| ATTRIBUTE | DESCRIPTION |
|---|---|
min_utility_type_usage |
Minimum expected utility-type references.
TYPE:
|
min_object_type_aliases |
Minimum object-type aliases before the rule activates.
TYPE:
|
TsNonNullAssertionConfig
¶
Bases: DetectorConfig
TypeScript non-null assertion (!) detection settings.
| ATTRIBUTE | DESCRIPTION |
|---|---|
max_non_null_assertions |
Maximum allowed
TYPE:
|
TsEnumConstConfig
¶
Bases: DetectorConfig
TypeScript const-enum preference settings.
| ATTRIBUTE | DESCRIPTION |
|---|---|
max_plain_enum_objects |
Maximum non-const enums before a violation.
TYPE:
|
TsUnknownOverAnyConfig
¶
Bases: DetectorConfig
TypeScript unknown-over-any preference settings.
| ATTRIBUTE | DESCRIPTION |
|---|---|
max_any_for_unknown |
Maximum
TYPE:
|
TsOptionalChainingConfig
¶
Bases: DetectorConfig
TypeScript optional-chaining enforcement settings.
| ATTRIBUTE | DESCRIPTION |
|---|---|
max_manual_null_checks |
Maximum manual null-check chains allowed.
TYPE:
|
TsIndexLoopConfig
¶
Bases: DetectorConfig
TypeScript index-loop enforcement settings.
| ATTRIBUTE | DESCRIPTION |
|---|---|
max_index_loops |
Maximum C-style index loops allowed.
TYPE:
|
TsPromiseChainConfig
¶
Bases: DetectorConfig
TypeScript promise-chain enforcement settings.
| ATTRIBUTE | DESCRIPTION |
|---|---|
max_promise_chains |
Maximum raw promise chains allowed.
TYPE:
|
TsDefaultExportConfig
¶
Bases: DetectorConfig
TypeScript default-export enforcement settings.
| ATTRIBUTE | DESCRIPTION |
|---|---|
max_default_exports |
Maximum default exports allowed.
TYPE:
|
TsCatchAllTypeConfig
¶
Bases: DetectorConfig
TypeScript catch-all type enforcement settings.
| ATTRIBUTE | DESCRIPTION |
|---|---|
max_catch_all_types |
Maximum catch-all type annotations allowed.
TYPE:
|
TsConsoleUsageConfig
¶
Bases: DetectorConfig
TypeScript console-usage enforcement settings.
| ATTRIBUTE | DESCRIPTION |
|---|---|
max_console_usages |
Maximum console.* calls allowed.
TYPE:
|
TsRequireImportConfig
¶
Bases: DetectorConfig
TypeScript require-import enforcement settings.
| ATTRIBUTE | DESCRIPTION |
|---|---|
max_require_calls |
Maximum require() calls allowed.
TYPE:
|
TsStringConcatConfig
¶
Bases: DetectorConfig
TypeScript string-concatenation enforcement settings.
| ATTRIBUTE | DESCRIPTION |
|---|---|
max_string_concats |
Maximum string concatenation patterns allowed.
TYPE:
|
TsAsyncAwaitConfig
¶
Bases: DetectorConfig
TypeScript async/await preference settings.
| ATTRIBUTE | DESCRIPTION |
|---|---|
max_then_chains |
Maximum raw
TYPE:
|
TsForOfConfig
¶
Bases: DetectorConfig
TypeScript for-of loop preference settings.
| ATTRIBUTE | DESCRIPTION |
|---|---|
max_index_based_loops |
Maximum C-style index loops allowed.
TYPE:
|
TsImportOrderConfig
¶
Bases: DetectorConfig
TypeScript import-order enforcement settings.
| ATTRIBUTE | DESCRIPTION |
|---|---|
max_require_usages |
Maximum
TYPE:
|
TsNamedExportConfig
¶
Bases: DetectorConfig
TypeScript named-export preference settings.
| ATTRIBUTE | DESCRIPTION |
|---|---|
max_default_export_usages |
Maximum
TYPE:
|
TsNoConsoleConfig
¶
Bases: DetectorConfig
TypeScript no-console enforcement settings.
| ATTRIBUTE | DESCRIPTION |
|---|---|
max_console_statements |
Maximum
TYPE:
|
TsObjectTypeConfig
¶
Bases: DetectorConfig
TypeScript object-type enforcement settings.
| ATTRIBUTE | DESCRIPTION |
|---|---|
max_object_types |
Maximum generic
TYPE:
|
TsTemplateLiteralConfig
¶
Bases: DetectorConfig
TypeScript template-literal preference settings.
| ATTRIBUTE | DESCRIPTION |
|---|---|
max_string_concatenations |
Maximum string concatenation patterns allowed.
TYPE:
|
JsCallbackNestingConfig
¶
Bases: DetectorConfig
JavaScript callback-nesting depth enforcement settings.
| ATTRIBUTE | DESCRIPTION |
|---|---|
max_callback_nesting |
Maximum permitted callback nesting levels.
TYPE:
|
JsNoVarConfig
¶
Bases: DetectorConfig
JavaScript var keyword prohibition settings.
| ATTRIBUTE | DESCRIPTION |
|---|---|
detect_var_usage |
When
TYPE:
|
JsStrictEqualityConfig
¶
JsAsyncErrorHandlingConfig
¶
JsFunctionLengthConfig
¶
Bases: DetectorConfig
JavaScript function-length and parameter-count enforcement settings.
| ATTRIBUTE | DESCRIPTION |
|---|---|
max_function_length |
Maximum lines per function body.
TYPE:
|
max_parameters |
Maximum formal parameters per function (
TYPE:
|
JsGlobalStateConfig
¶
JsModernFeaturesConfig
¶
JsMagicNumbersConfig
¶
JsPureFunctionConfig
¶
BashStrictModeConfig
¶
BashQuoteVariablesConfig
¶
BashEvalUsageConfig
¶
BashDoubleBracketsConfig
¶
BashCommandSubstitutionConfig
¶
BashReadonlyConstantsConfig
¶
BashExitCodeConfig
¶
BashLocalVariablesConfig
¶
BashArgumentValidationConfig
¶
BashSignalHandlingConfig
¶
BashArrayUsageConfig
¶
BashUsageInfoConfig
¶
PowerShellApprovedVerbConfig
¶
Bases: DetectorConfig
PowerShell approved-verb enforcement settings.
| ATTRIBUTE | DESCRIPTION |
|---|---|
approved_verbs |
Accepted verb prefixes for cmdlet names.
TYPE:
|
PowerShellErrorHandlingConfig
¶
PowerShellPascalCaseConfig
¶
Bases: DetectorConfig
PowerShell PascalCase naming-convention enforcement settings.
| ATTRIBUTE | DESCRIPTION |
|---|---|
naming_convention |
Expected casing pattern (
TYPE:
|
PowerShellCmdletBindingConfig
¶
PowerShellVerboseDebugConfig
¶
PowerShellPositionalParamsConfig
¶
PowerShellPipelineUsageConfig
¶
PowerShellShouldProcessConfig
¶
PowerShellSplattingConfig
¶
PowerShellParameterValidationConfig
¶
PowerShellCommentHelpConfig
¶
PowerShellAliasUsageConfig
¶
PowerShellReturnObjectsConfig
¶
PowerShellScopeUsageConfig
¶
PowerShellNullHandlingConfig
¶
RubyNamingConventionConfig
¶
Bases: DetectorConfig
Ruby naming-convention enforcement settings.
| ATTRIBUTE | DESCRIPTION |
|---|---|
naming_convention |
Expected casing style (
TYPE:
|
RubyMethodChainConfig
¶
Bases: DetectorConfig
Ruby method-chain length enforcement settings.
| ATTRIBUTE | DESCRIPTION |
|---|---|
max_method_chain_length |
Maximum chained method calls per expression.
TYPE:
|
RubyDryConfig
¶
RubyBlockPreferenceConfig
¶
RubyMonkeyPatchConfig
¶
RubyMethodNamingConfig
¶
RubySymbolKeysConfig
¶
RubyGuardClauseConfig
¶
RubyMetaprogrammingConfig
¶
RubyExpressiveSyntaxConfig
¶
RubyPreferFailConfig
¶
CppSmartPointerConfig
¶
CppNullptrConfig
¶
CppRaiiConfig
¶
CppAutoConfig
¶
CppRangeForConfig
¶
CppManualAllocationConfig
¶
CppConstCorrectnessConfig
¶
CppCStyleCastConfig
¶
CppRuleOfFiveConfig
¶
CppMoveConfig
¶
CppAvoidGlobalsConfig
¶
CppOverrideFinalConfig
¶
CppOptionalConfig
¶
CSharpAsyncAwaitConfig
¶
CSharpStringInterpolationConfig
¶
CSharpNullableConfig
¶
CSharpExpressionBodiedConfig
¶
CSharpVarConfig
¶
CSharpPatternMatchingConfig
¶
CSharpCollectionExpressionConfig
¶
CSharpDisposableConfig
¶
CSharpMagicNumberConfig
¶
CSharpLinqConfig
¶
CSharpExceptionHandlingConfig
¶
CSharpRecordConfig
¶
CssSpecificityConfig
¶
CssMagicPixelsConfig
¶
CssColorLiteralConfig
¶
CssGodStylesheetConfig
¶
CssImportChainConfig
¶
CssZIndexScaleConfig
¶
CssVendorPrefixConfig
¶
CssMediaQueryScaleConfig
¶
YamlIndentationConfig
¶
Bases: DetectorConfig
YAML indentation width enforcement settings.
| ATTRIBUTE | DESCRIPTION |
|---|---|
indent_size |
Expected number of spaces per indentation level (default 2).
TYPE:
|
YamlNoTabsConfig
¶
YamlDuplicateKeysConfig
¶
YamlLowercaseKeysConfig
¶
YamlKeyClarityConfig
¶
Bases: DetectorConfig
YAML minimum key-length enforcement settings.
| ATTRIBUTE | DESCRIPTION |
|---|---|
min_key_length |
Shortest acceptable mapping-key length (default 3).
TYPE:
|
YamlConsistencyConfig
¶
Bases: DetectorConfig
YAML list-marker consistency enforcement settings.
| ATTRIBUTE | DESCRIPTION |
|---|---|
allowed_list_markers |
Permitted sequence indicators (default
TYPE:
|
YamlCommentIntentConfig
¶
Bases: DetectorConfig
YAML comment-coverage enforcement settings.
| ATTRIBUTE | DESCRIPTION |
|---|---|
min_comment_lines |
Minimum number of comment lines required.
TYPE:
|
min_nonempty_lines |
File must exceed this line count before the rule applies.
TYPE:
|
YamlStringStyleConfig
¶
Bases: DetectorConfig
YAML string quoting enforcement settings.
| ATTRIBUTE | DESCRIPTION |
|---|---|
require_quotes_for_specials |
When
TYPE:
|
AnsibleNamingConfig
¶
AnsibleFqcnConfig
¶
AnsibleIdempotencyConfig
¶
AnsibleBecomeConfig
¶
AnsibleStateExplicitConfig
¶
AnsibleNoCleartextPasswordConfig
¶
AnsibleJinjaSpacingConfig
¶
AnsibleReadabilityCountsConfig
¶
AnsibleUserOutcomeConfig
¶
AnsibleUserExperienceConfig
¶
AnsibleMagicAutomationConfig
¶
AnsibleConventionOverConfigConfig
¶
AnsibleDeclarativeBiasConfig
¶
AnsibleFocusConfig
¶
AnsibleComplexityKillsProductivityConfig
¶
AnsibleExplainabilityConfig
¶
AnsibleAutomationOpportunityConfig
¶
AnsibleContinuousImprovementConfig
¶
AnsibleFrictionConfig
¶
AnsibleAutomationJourneyConfig
¶
TerraformProviderVersionPinningConfig
¶
TerraformModuleVersionPinningConfig
¶
TerraformVariableOutputDescriptionConfig
¶
TerraformHardcodedIdConfig
¶
TerraformNoHardcodedSecretsConfig
¶
TerraformBackendConfig
¶
TerraformNamingConventionConfig
¶
DockerfileLatestTagConfig
¶
DockerfileNonRootUserConfig
¶
DockerfileAddInstructionConfig
¶
DockerfileHealthcheckConfig
¶
DockerfileMultiStageConfig
¶
DockerfileSecretHygieneConfig
¶
DockerfileLayerDisciplineConfig
¶
DockerfileDockerignoreConfig
¶
DockerComposeLatestTagConfig
¶
DockerComposeNonRootUserConfig
¶
DockerComposeHealthcheckConfig
¶
DockerComposeSecretHygieneConfig
¶
GitLabCIUnpinnedImageConfig
¶
GitLabCIExposedVariablesConfig
¶
GitLabCIAllowFailureConfig
¶
GitLabCIGodPipelineConfig
¶
GitLabCIDuplicatedBeforeScriptConfig
¶
GitLabCIMissingInterruptibleConfig
¶
GitLabCIMissingNeedsConfig
¶
GitLabCIOnlyExceptConfig
¶
GitLabCIMissingCacheConfig
¶
GitLabCIArtifactExpiryConfig
¶
TomlNoInlineTablesConfig
¶
TomlDuplicateKeysConfig
¶
TomlLowercaseKeysConfig
¶
TomlTrailingCommasConfig
¶
TomlCommentClarityConfig
¶
Bases: DetectorConfig
TOML comment-coverage enforcement settings.
| ATTRIBUTE | DESCRIPTION |
|---|---|
min_comment_lines |
Minimum number of comment lines before the rule passes.
TYPE:
|
TomlOrderConfig
¶
TomlIsoDatetimeConfig
¶
TomlFloatIntegerConfig
¶
JsonStrictnessConfig
¶
JsonSchemaConsistencyConfig
¶
JsonDuplicateKeyConfig
¶
JsonMagicStringConfig
¶
Bases: DetectorConfig
JSON magic-string repetition detection settings.
| ATTRIBUTE | DESCRIPTION |
|---|---|
min_repetition |
Minimum occurrences of a string value to flag it.
TYPE:
|
min_length |
Minimum string length to consider as a magic-string candidate.
TYPE:
|
JsonKeyCasingConfig
¶
JsonArrayOrderConfig
¶
JsonNullSprawlConfig
¶
Bases: DetectorConfig
JSON null-sprawl detection settings.
| ATTRIBUTE | DESCRIPTION |
|---|---|
max_null_values |
Maximum total null values permitted across the document.
TYPE:
|
JsonDateFormatConfig
¶
Bases: DetectorConfig
JSON ISO 8601 date-format enforcement settings.
| ATTRIBUTE | DESCRIPTION |
|---|---|
common_date_keys |
Key name fragments used to identify probable date fields.
TYPE:
|
JsonNullHandlingConfig
¶
Bases: DetectorConfig
JSON top-level explicit-null detection settings.
| ATTRIBUTE | DESCRIPTION |
|---|---|
max_top_level_nulls |
Maximum number of top-level object keys allowed to be set explicitly to null before a violation is raised.
TYPE:
|
MarkdownHeadingHierarchyConfig
¶
MarkdownAltTextConfig
¶
MarkdownBareUrlConfig
¶
MarkdownCodeFenceLanguageConfig
¶
MarkdownFrontMatterConfig
¶
MarkdownMdxNamedDefaultExportConfig
¶
MarkdownMdxImportHygieneConfig
¶
MarkdownDocumentConfig
¶
MarkdownMdxConfig
¶
XmlSemanticMarkupConfig
¶
XmlAttributeUsageConfig
¶
XmlNamespaceConfig
¶
XmlValidityConfig
¶
XmlHierarchyConfig
¶
XmlClosingTagsConfig
¶
SvgNodeCountConfig
¶
SvgMissingTitleConfig
¶
SvgAriaRoleConfig
¶
SvgImageAltConfig
¶
SvgDescForComplexGraphicsConfig
¶
SvgInlineStyleConfig
¶
SvgViewBoxConfig
¶
SvgUnusedDefsConfig
¶
SvgNestedGroupsConfig
¶
SvgDuplicateIdConfig
¶
SvgAbsolutePathOnlyConfig
¶
SvgBase64ImageConfig
¶
SvgXmlnsConfig
¶
SvgDeprecatedXlinkHrefConfig
¶
SvgProductionBloatConfig
¶
LatexMacroDefinitionConfig
¶
LatexLabelRefDisciplineConfig
¶
LatexCaptionCompletenessConfig
¶
LatexBibliographyHygieneConfig
¶
LatexWidthAbstractionConfig
¶
LatexSemanticMarkupConfig
¶
LatexIncludeLoopConfig
¶
LatexEncodingDeclarationConfig
¶
LatexUnusedPackagesConfig
¶
GoErrorHandlingConfig
¶
Bases: DetectorConfig
Go error-handling enforcement settings.
| ATTRIBUTE | DESCRIPTION |
|---|---|
max_ignored_errors |
Maximum
TYPE:
|
GoInterfaceSizeConfig
¶
Bases: DetectorConfig
Go interface-size enforcement settings.
| ATTRIBUTE | DESCRIPTION |
|---|---|
max_interface_methods |
Maximum methods per interface.
TYPE:
|
GoContextUsageConfig
¶
Bases: DetectorConfig
Go context.Context propagation enforcement settings.
| ATTRIBUTE | DESCRIPTION |
|---|---|
require_context |
Require
TYPE:
|
GoDeferUsageConfig
¶
Bases: DetectorConfig
Go defer usage enforcement settings.
| ATTRIBUTE | DESCRIPTION |
|---|---|
detect_defer_in_loop |
Flag
TYPE:
|
detect_missing_defer |
Flag resource opens without matching
TYPE:
|
GoNamingConventionConfig
¶
Bases: DetectorConfig
Go naming-convention enforcement settings.
| ATTRIBUTE | DESCRIPTION |
|---|---|
detect_long_names |
Flag overly long identifier names.
TYPE:
|
GoInterfaceReturnConfig
¶
GoZeroValueConfig
¶
GoInterfacePointerConfig
¶
GoGoroutineLeakConfig
¶
GoPackageNamingConfig
¶
GoPackageStateConfig
¶
GoInitUsageConfig
¶
GoSinglePurposePackageConfig
¶
GoEarlyReturnConfig
¶
GoEmbeddingDepthConfig
¶
Bases: DetectorConfig
Go struct embedding depth enforcement settings.
| ATTRIBUTE | DESCRIPTION |
|---|---|
max_embedding_depth |
Maximum number of anonymously embedded types per struct.
TYPE:
|
GoConcurrencyCallerConfig
¶
GoSimplicityConfig
¶
GoTestPresenceConfig
¶
GoBenchmarkConfig
¶
GoModerationConfig
¶
Bases: DetectorConfig
Go goroutine moderation enforcement settings.
| ATTRIBUTE | DESCRIPTION |
|---|---|
max_goroutine_spawns |
Maximum
TYPE:
|
GoMaintainabilityConfig
¶
RustUnwrapUsageConfig
¶
Bases: DetectorConfig
Rust unwrap() avoidance settings.
| ATTRIBUTE | DESCRIPTION |
|---|---|
max_unwraps |
Maximum permitted
TYPE:
|
RustUnsafeBlocksConfig
¶
Bases: DetectorConfig
Rust unsafe block detection settings.
| ATTRIBUTE | DESCRIPTION |
|---|---|
detect_unsafe_blocks |
When
TYPE:
|
RustCloneOverheadConfig
¶
Bases: DetectorConfig
Rust excessive .clone() detection settings.
| ATTRIBUTE | DESCRIPTION |
|---|---|
max_clone_calls |
Maximum permitted
TYPE:
|
RustErrorHandlingConfig
¶
Bases: DetectorConfig
Rust error-handling enforcement settings.
| ATTRIBUTE | DESCRIPTION |
|---|---|
detect_unhandled_results |
Flag unhandled
TYPE:
|
max_panics |
Maximum permitted
TYPE:
|
RustTypeSafetyConfig
¶
Bases: DetectorConfig
Rust newtype/type-safety preference settings.
| ATTRIBUTE | DESCRIPTION |
|---|---|
primitive_types |
Primitive types that should be wrapped in newtypes.
TYPE:
|
RustIteratorPreferenceConfig
¶
Bases: DetectorConfig
Rust iterator-over-loop preference settings.
| ATTRIBUTE | DESCRIPTION |
|---|---|
max_loops |
Maximum
TYPE:
|
RustMustUseConfig
¶
RustDebugDeriveConfig
¶
RustNewtypePatternConfig
¶
Bases: DetectorConfig
Rust newtype-pattern enforcement settings.
| ATTRIBUTE | DESCRIPTION |
|---|---|
primitive_types |
Types that should be wrapped as newtypes.
TYPE:
|
RustStdTraitsConfig
¶
RustEnumOverBoolConfig
¶
Bases: DetectorConfig
Rust enum-over-boolean preference settings.
| ATTRIBUTE | DESCRIPTION |
|---|---|
max_bool_fields |
Maximum
TYPE:
|
RustLifetimeUsageConfig
¶
Bases: DetectorConfig
Rust explicit-lifetime minimization settings.
| ATTRIBUTE | DESCRIPTION |
|---|---|
max_explicit_lifetimes |
Maximum explicit lifetime annotations.
TYPE:
|
RustInteriorMutabilityConfig
¶
RustSendSyncConfig
¶
RustErrorTraitsConfig
¶
RustNamingConfig
¶
RustDefaultImplConfig
¶
RustFromIntoConfig
¶
Bash006Config
¶
Bases: DetectorConfig
Bash script-length-without-functions enforcement settings.
| ATTRIBUTE | DESCRIPTION |
|---|---|
max_script_length_without_functions |
Maximum line count before requiring function decomposition.
TYPE:
|
Bash011Config
¶
Bases: DetectorConfig
Bash minimum variable-name-length enforcement settings.
| ATTRIBUTE | DESCRIPTION |
|---|---|
min_variable_name_length |
Shortest acceptable variable name.
TYPE:
|
Js009Config
¶
Bases: DetectorConfig
JavaScript class inheritance-depth enforcement settings.
| ATTRIBUTE | DESCRIPTION |
|---|---|
max_inheritance_depth |
Maximum allowed
TYPE:
|
Js011Config
¶
Bases: DetectorConfig
JavaScript minimum identifier-length enforcement settings.
| ATTRIBUTE | DESCRIPTION |
|---|---|
min_identifier_length |
Shortest acceptable identifier name.
TYPE:
|
JsDestructuringConfig
¶
JsObjectSpreadConfig
¶
JsNoWithConfig
¶
JsParamCountConfig
¶
JsNoEvalConfig
¶
JsNoArgumentsConfig
¶
JsNoPrototypeMutationConfig
¶
Cs008Config
¶
Bases: DetectorConfig
C# public/private naming-convention enforcement settings.
| ATTRIBUTE | DESCRIPTION |
|---|---|
public_naming |
Expected naming style for public members.
TYPE:
|
private_naming |
Expected naming style for private members.
TYPE:
|