Skip to content

S001 Edge Cases

IDScenarioExpected Behavior
S001-EC-001parity.yaml does not exist in cwd and --config not providedPrint error: parity.yaml not found. Run from project root, place parity.yaml there, or use --config=path. Return exit code 1.
S001-EC-002parity.yaml exists but file_get_contents() returns false (unreadable)Print error: Could not read config: {path}. Return exit code 1.
S001-EC-003parity.yaml contains invalid YAML (malformed syntax)Symfony Yaml parser throws ParseException. The exception MUST propagate or be caught and reported. Return exit code 1.
S001-EC-004All coverage_xml candidate paths resolve to nonexistent files/directoriesPrint error: No coverage file or directory found (tried: {comma-separated list}). Return exit code 1.
S001-EC-005structure key is present but its value is an empty arrayPrint warning: No structure entries in parity.yaml. Return exit code 0 (success -- no structures means no violations).
S001-EC-006A structure entry's source path points to a directory that does not existPrint warning: Source path does not exist: {path}. Skip the structure entry. Continue processing remaining structures. Do not treat as failure.
S001-EC-007A source directory exists but contains no files matching source_extensionProduce an empty table for that structure (no file rows). The structure does not contribute any failures.
S001-EC-008--config flag points to a file that does not exist (realpath() returns false)Print error: parity.yaml not found. Run from project root, place parity.yaml there, or use --config=path. Return exit code 1. Same error as S001-EC-001 -- the command does not distinguish between missing cwd config and missing --config target.
S001-EC-009getcwd() returns false (e.g., cwd has been deleted) during check without --configresolveProjectRoot() returns null. Print S001-FR-002.c error. Return exit code 1.
S001-EC-010--format is given with an invalid value (e.g., --format=csv)The value is not json, so $isJson is false. The command falls through to table mode. No explicit validation error is raised.
S001-EC-011getcwd() returns false during init commandPrint error: Could not determine current directory. Return exit code 1.
S001-EC-012parity init runs in a directory where the user lacks write permissionsfile_put_contents() returns false. Print error: Could not write parity.yaml. Return exit code 1.
S001-EC-013Plugins produce warnings while --format=json is activePlugin warnings MUST NOT be printed to stdout. The JSON output remains clean. Warnings are silently suppressed.
S001-EC-014symfony/yaml package is not installedPrint error: Install symfony/yaml to use parity.yaml, or use a PHP config. Return exit code 1. loadConfig() checks class_exists(Yaml::class) before parsing.