best_practices
best_practices
¶
Best-practice validation checks.
Detects common configuration pitfalls and suggests improvements for reliability, correctness, and performance.
Attributes¶
Classes¶
JinjaInValidationPathCheck
¶
Check for Jinja syntax in validation paths and commands (V201).
Validation paths and commands use Python .format() syntax
({workspace}), not Jinja ({{ workspace }}). Jinja syntax renders
literally with braces intact: a path never exists and a command runs
cd {{ workspace }} (examples QA 21 Oct, prefabrication F16).
Methods:¶
check
¶
Check validation paths and commands for {{ markers.
Source code in src/marianne/validation/checks/best_practices.py
PlaceholderQuotingCheck
¶
A {placeholder} in a command is ONE shell-quoted word (V333).
The engine substitutes every placeholder with shlex.quote(value).
Two command shapes can never work with that and fail only at runtime,
with a value that needs quoting (GH #477):
- a bash array literal,
xs=({list})— one element, never split; - a placeholder spliced inside an interpreter's string literal,
python3 -c "open('{workspace}/x')"— the shell quotes survive inside the Python string, so'~/triage'reachesexpanduser()with its quotes (issue-solver sheet 12, four attempts lost).
FormatSyntaxInTemplateCheck
¶
Check for format-string syntax in Jinja templates (V202).
Prompt templates use Jinja ({{ name }}), not Python format strings
({name}). Only flags known built-in names to avoid false positives.
Methods:¶
check
¶
Scan prompt template for {builtin_name} patterns.
Source code in src/marianne/validation/checks/best_practices.py
NoValidationsCheck
¶
Check that at least one validation rule exists (V203).
Without validations, sheets always "pass" and you learn nothing about execution quality.
Methods:¶
check
¶
Fire when no validations are configured.
Source code in src/marianne/validation/checks/best_practices.py
FileExistsOnlyCheck
¶
Check for file_exists-only validations (V205).
file_exists alone cannot detect stale files left from a
previous run. Adding file_modified or content checks is
recommended.
Methods:¶
check
¶
Fire when every validation is file_exists.
Source code in src/marianne/validation/checks/best_practices.py
FanOutWithoutDependenciesCheck
¶
Check fan-out configs have dependencies (V206).
When fan-out stages are configured without dependencies, stages may execute out of order.
Methods:¶
check
¶
Fire when fan-out is configured without dependencies.
Source code in src/marianne/validation/checks/best_practices.py
FanOutWithoutParallelCheck
¶
Check fan-out configs enable parallel execution (V207).
Fan-out instances are designed to run concurrently, but will execute sequentially if parallel mode is disabled.
Methods:¶
check
¶
Fire when fan-out is configured without parallel.
Source code in src/marianne/validation/checks/best_practices.py
VariableShadowingCheck
¶
Check for user variables that shadow built-ins (V208).
User-defined prompt variables that share names with Marianne's built-in variables will override the real values, causing unexpected behavior.
Methods:¶
check
¶
Fire when prompt.variables shadows a built-in name.
Source code in src/marianne/validation/checks/best_practices.py
SkipWhenSheetRangeCheck
¶
Check that skip_when keys are in-range (V212).
Each key in skip_when must satisfy 1 ≤ k ≤ total_sheets. Out-of-range keys are silently ignored at runtime — they will never fire. This is a WARNING (non-blocking) because the config is executable, just suspicious.
Methods:¶
check
¶
Warn when skip_when keys are out of range.
Source code in src/marianne/validation/checks/best_practices.py
SkipWhenArchiveFreshCheck
¶
Warn when skip_when unchanged is used with workspace_lifecycle.archive_on_fresh (V339).
archive_on_fresh archives .marianne/ and non-preserved outputs before dispatch, so unchanged rules find no record or missing products and never skip.
FanOutMessagingCheck
¶
Warn when an explicit messaging mode has no concurrent siblings (V235).