Skip to content

Validate configuration before analysis - #15

Merged
Vashkatsi merged 2 commits into
mainfrom
fix/validate-before-analysis
Aug 7, 2026
Merged

Validate configuration before analysis#15
Vashkatsi merged 2 commits into
mainfrom
fix/validate-before-analysis

Conversation

@Vashkatsi

@Vashkatsi Vashkatsi commented Aug 7, 2026

Copy link
Copy Markdown
Owner

What changed

  • run the existing configuration validation before deply analyze creates a runner
  • reject file-valued analysis paths, unknown collector fields, and invalid element_type values
  • preserve exclude_files_regex compatibility for every collector, including bool and custom
  • keep successful analysis preflight silent while preserving deply validate output
  • update CLI/configuration documentation and mark the roadmap item resolved

Root cause

deply analyze parsed configuration directly through DeplyRunner without invoking ConfigValidator. Missing paths and other invalid settings could therefore produce a successful analysis with zero violations. The validator also lacked directory checks and per-collector key validation.

Impact

Invalid configuration now fails with exit status 1 and the existing Invalid deply configuration: error format before project files are scanned. Valid CLI, config, and report behavior remains unchanged.

Validation

  • ./.venv/bin/python -m unittest tests.test_config_validator tests.test_main_and_config_parser — 33 passed
  • make check — ruff, mypy, pip-audit, 160 tests passed
  • make mutation — 1698 mutants completed; no timeout, suspicious, or untested-file results
  • git diff --check
  • independent high-effort review — PASS

Summary by CodeRabbit

  • New Features

    • Added stricter configuration validation for collector fields, analysis directories, and supported element types.
    • deply analyze now validates configuration before scanning project files and exits with status 1 when validation fails.
  • Documentation

    • Updated CLI, configuration, and feature documentation to describe pre-analysis validation and supported settings.
  • Tests

    • Expanded coverage for invalid paths, unknown fields, unsupported element types, and analysis validation behavior.

@coderabbitai

coderabbitai Bot commented Aug 7, 2026

Copy link
Copy Markdown

Review Change Stack

No actionable comments were generated in the recent review. 🎉

ℹ️ Recent review info
⚙️ Run configuration

Configuration used: defaults

Review profile: CHILL

Plan: Pro Plus

Run ID: 3cc7f79e-6964-457f-89c8-fdd4a2538a1c

📥 Commits

Reviewing files that changed from the base of the PR and between a6f13c0 and d7926bb.

📒 Files selected for processing (8)
  • README.md
  • deply/config_validator.py
  • deply/main.py
  • doc/cli.md
  • doc/configuration.md
  • doc/technical-roadmap.md
  • tests/test_config_validator.py
  • tests/test_main_and_config_parser.py

📝 Walkthrough

Walkthrough

The change adds stricter collector and path validation. deply analyze now validates configuration before creating DeplyRunner, suppresses duplicate success output, and exits with status 1 for invalid configuration. Tests and documentation cover the updated behavior.

Changes

Configuration Validation Preflight

Layer / File(s) Summary
Validator rules and coverage
deply/config_validator.py, tests/test_config_validator.py
ConfigValidator now checks collector keys, analysis directories, and supported element_type values. Tests cover valid and invalid configurations.
Analysis validation preflight
deply/main.py, tests/test_main_and_config_parser.py
deply analyze validates configuration before creating DeplyRunner. Invalid configuration returns status 1; valid analysis suppresses the validation-success message.
Validation behavior documentation
README.md, doc/cli.md, doc/configuration.md, doc/technical-roadmap.md
Documentation describes automatic pre-analysis validation, supported validation rules, and invalid-configuration behavior.

Estimated code review effort: 3 (Moderate) | ~20 minutes

Possibly related PRs

  • Vashkatsi/deply#11: Introduced the ConfigValidator and validate_configuration functionality extended by this change.
  • Vashkatsi/deply#12: Documents related configuration validation and collector rules.
🚥 Pre-merge checks | ✅ 5
✅ Passed checks (5 passed)
Check name Status Explanation
Description Check ✅ Passed Check skipped - CodeRabbit’s high-level summary is enabled.
Title check ✅ Passed The title clearly and concisely describes the main change: validating configuration before analysis.
Docstring Coverage ✅ Passed No functions found in the changed files to evaluate docstring coverage. Skipping docstring coverage check.
Linked Issues check ✅ Passed Check skipped because no linked issues were found for this pull request.
Out of Scope Changes check ✅ Passed Check skipped because no linked issues were found for this pull request.
✨ Finishing Touches
📝 Generate docstrings
  • Create stacked PR
  • Commit on current branch
🧪 Generate unit tests (beta)
  • Create PR with unit tests
  • Commit unit tests in branch fix/validate-before-analysis

Thanks for using CodeRabbit! It's free for OSS, and your support helps us grow. If you like it, consider giving us a shout-out.

❤️ Share

Comment @coderabbitai help to get the list of available commands.

@Vashkatsi
Vashkatsi marked this pull request as ready for review August 7, 2026 17:06
@Vashkatsi
Vashkatsi merged commit 9b47470 into main Aug 7, 2026
14 checks passed
Sign up for free to join this conversation on GitHub. Already have an account? Sign in to comment

Labels

None yet

Projects

None yet

Development

Successfully merging this pull request may close these issues.

1 participant