Skip to content

Add complexipy - #530

Open
ppinchuk wants to merge 21 commits into
mainfrom
pp/complexipy
Open

Add complexipy#530
ppinchuk wants to merge 21 commits into
mainfrom
pp/complexipy

Conversation

@ppinchuk

Copy link
Copy Markdown
Collaborator

Add complexipy as a linter in CI

@ppinchuk ppinchuk self-assigned this Aug 19, 2026
Copilot AI lite review requested due to automatic review settings August 19, 2026 00:40
@ppinchuk
ppinchuk requested a review from castelao as a code owner August 19, 2026 00:40
@ppinchuk ppinchuk added enhancement Update to logic or general code improvements chore Maintenance work that does not impact the user p-low Priority: low topic-python-general Issues/pull requests related to python github_actions Pull requests that update GitHub Actions code labels Aug 19, 2026
@codecov-commenter

codecov-commenter commented Aug 19, 2026

Copy link
Copy Markdown

Codecov Report

❌ Patch coverage is 74.12587% with 37 lines in your changes missing coverage. Please review.
✅ Project coverage is 64.35%. Comparing base (1ba6355) to head (9ffae98).

Files with missing lines Patch % Lines
compass/pipeline/data_classes.py 17.64% 14 Missing ⚠️
compass/llm/config.py 50.00% 7 Missing ⚠️
compass/web/file_loader.py 76.00% 4 Missing and 2 partials ⚠️
compass/validation/content.py 73.68% 2 Missing and 3 partials ⚠️
compass/utilities/parsing.py 70.00% 2 Missing and 1 partial ⚠️
compass/common/base.py 0.00% 1 Missing ⚠️
compass/web/search.py 90.00% 0 Missing and 1 partial ⚠️

❌ Your patch status has failed because the patch coverage (74.12%) is below the target coverage (80.00%). You can increase the patch coverage or adjust the target coverage.

Additional details and impacted files
@@            Coverage Diff             @@
##             main     #530      +/-   ##
==========================================
+ Coverage   63.95%   64.35%   +0.40%     
==========================================
  Files          78       78              
  Lines        7446     7491      +45     
  Branches      755      754       -1     
==========================================
+ Hits         4762     4821      +59     
+ Misses       2524     2512      -12     
+ Partials      160      158       -2     
Flag Coverage Δ
unittests 64.35% <74.12%> (+0.40%) ⬆️

Flags with carried forward coverage won't be shown. Click here to find out more.

☔ View full report in Codecov by Harness.
📢 Have feedback on the report? Share it here.

🚀 New features to boost your workflow:
  • ❄️ Test Analytics: Detect flaky tests, report on failures, and find test suite problems.

Copilot AI left a comment

Copy link
Copy Markdown
Contributor

Choose a reason for hiding this comment

The reason will be displayed to describe this comment to others. Learn more.

Pull request overview

This PR adds complexipy complexity checking to the Python CI lint job and refactors several Python modules to reduce reported cyclomatic complexity (primarily by extracting helper functions).

Changes:

  • Add complexipy to Python dev dependencies and introduce [tool.complexipy] configuration.
  • Extend the Python CI lint workflow to run Complexipy alongside Ruff lint/format checks.
  • Refactor multiple functions across web, pipeline, validation, and config modules to reduce complexity.

Reviewed changes

Copilot reviewed 15 out of 16 changed files in this pull request and generated 5 comments.

Show a summary per file
File Description
pyproject.toml Adds complexipy to dev extras and configures [tool.complexipy].
pixi.toml Adds complexipy to the python-dev feature PyPI dependencies.
pixi.lock Locks complexipy wheels across platforms/environments.
.github/workflows/ci-python.yml Adds a Complexipy step to the lint job.
compass/web/website_crawl.py Extracts helper functions and simplifies link sanitization/blacklist checks.
compass/web/search.py Extracts helpers for parsing lists and blacklist/whitelist matching.
compass/web/file_loader.py Extracts helper functions for failed-search collection and ELM/doc selection.
compass/validation/content.py Refactors chunk-selection logic into async helpers.
compass/utilities/parsing.py Extracts PDF raw-page handling into a helper.
compass/services/cpu.py Adds Complexipy ignore directive for a helper.
compass/plugin/one_shot/base.py Refactors heuristic keyword normalization into smaller helpers.
compass/pipeline/data_classes.py Extracts helper functions for task/config building and validation.
compass/pipeline/collection/persistence.py Extracts manifest loading and duplicate-jurisdiction validation.
compass/pipeline/collection/base.py Refactors execution flow and persists step state on the collector instance.
compass/llm/config.py Adds safe token-count fallback and refactors client kwarg env fallback logic.
compass/common/base.py Moves Ruff ignore directive to align with updated function structure.

💡 Add a code-review agent skill or configure MCP servers for context-aware, tailored reviews. Learn more in the docs.

Comment thread compass/validation/content.py Outdated
Comment thread compass/llm/config.py
Comment thread .github/workflows/ci-python.yml
Comment thread compass/llm/config.py
Comment thread compass/llm/config.py

@castelao castelao left a comment

Copy link
Copy Markdown
Member

Choose a reason for hiding this comment

The reason will be displayed to describe this comment to others. Learn more.

Indeed it is interesting how it forces the code to be more readable. I agree that it is a good addition, knowing that in some rare moments we might want to bypass it, as you already did in this PR. Thanks for adding it!

Sign up for free to join this conversation on GitHub. Already have an account? Sign in to comment

Labels

chore Maintenance work that does not impact the user enhancement Update to logic or general code improvements github_actions Pull requests that update GitHub Actions code p-low Priority: low topic-python-general Issues/pull requests related to python

Projects

None yet

Development

Successfully merging this pull request may close these issues.

4 participants