refactor: tighten stage 1 ruff thresholds#1113
refactor: tighten stage 1 ruff thresholds#1113zeel2104 wants to merge 5 commits intomicrosoft:mainfrom
Conversation
There was a problem hiding this comment.
Pull request overview
Refactors several high-complexity/return-pressure hotspots to meet Stage 1 Ruff thresholds, and updates the Ruff thresholds in pyproject.toml accordingly (per #1077).
Changes:
- Updates Ruff complexity/args/returns thresholds to Stage 1 targets in
pyproject.toml. - Extracts helper functions to reduce complexity/returns in MCP installation and marketplace publishing flows.
- Reduces install wrapper argument pressure by introducing an options dataclass and
**kwargsvalidation.
Reviewed changes
Copilot reviewed 10 out of 10 changed files in this pull request and generated 4 comments.
Show a summary per file
| File | Description |
|---|---|
| src/apm_cli/policy/policy_checks.py | Refactors check execution into iterable loops for dependency + MCP policy checks. |
| src/apm_cli/marketplace/semver.py | Simplifies comparison operator handling via a small operator/comparator table. |
| src/apm_cli/marketplace/publisher.py | Splits per-target publish processing into smaller checkout/load/guard/write/commit/push helpers. |
| src/apm_cli/integration/mcp_integrator.py | Extracts runtime selection, dependency splitting, registry/self-defined install, and summary helpers to reduce install complexity. |
| src/apm_cli/install/validation.py | Adds targeted Ruff waivers for legacy complexity outliers. |
| src/apm_cli/install/services.py | Adds targeted Ruff waiver for max-args on a legacy entry point. |
| src/apm_cli/install/mcp/conflicts.py | Adds targeted Ruff waiver for max-args on a legacy validator. |
| src/apm_cli/install/mcp/command.py | Adds targeted Ruff waiver for max-args on a legacy command wrapper. |
| src/apm_cli/commands/install.py | Introduces frozen options dataclass for _install_apm_dependencies and switches wrapper to **kwargs. |
| pyproject.toml | Tightens Ruff thresholds to Stage 1 values (statements/branches/complexity/args/returns). |
|
Hey @zeel2104 -- welcome and thanks for picking up #1077! The strangler-fig direction here is exactly right, and the threshold reductions are meaningful. Great first contribution. I can see that commit There are still a few CI blockers that need addressing before we can proceed: CI failures
RebaseThe branch currently has merge conflicts with Once these are resolved, we will trigger a full panel evaluation of the PR. Happy to help if you have any questions -- just ping here. Thanks again! |
|
Thanks for the follow-up. I addressed the remaining Ruff/CI and merge-conflict issues. |
Description
Tightens the Stage 1 Ruff complexity thresholds for the strangler-fig refactor work and trims the main outliers blocking those guardrails.
Changes include:
MCPIntegrator.installby extracting runtime selection, registry install, self-defined install, and summary helpers.pyproject.tomlto the Stage 1 targets.Fixes #1077
Type of change
Testing
Validation run: