Skip to content

refactor: reduce complexity of resolve_spec in compile/imports/mod.rs - #2403

Draft
github-actions[bot] wants to merge 1 commit into
mainfrom
refactor/reduce-complexity-resolve-spec-33d051dde3191e37
Draft

github-actions[bot] wants to merge 1 commit into
mainfrom
refactor/reduce-complexity-resolve-spec-33d051dde3191e37

Conversation

@github-actions

Copy link
Copy Markdown
Contributor

resolve_spec was 146 lines (clippy too_many_lines 146/100) because it handled both local and remote imports inline.

It now dispatches to two helpers, resolve_local_spec and resolve_remote_spec. The bodies moved over unchanged, so behaviour is the same. resolve_spec is no longer flagged by too_many_lines.

Validation:

  • cargo build: passed
  • cargo test imports: passed (60 tests in the main test binary, plus the other test targets, all passing)
  • cargo clippy --all-targets --all-features -- -W clippy::too_many_lines: resolve_spec no longer flagged. resolve_imports_with_repo_root at line 686 is still flagged; that is a separate function and was not changed.

I did not run the full cargo test suite.

Generated by Cyclomatic Complexity Reducer · auto · 27.5 AIC · ⊞ 6.5K · ◷

Co-authored-by: Copilot <223556219+Copilot@users.noreply.github.com>
@azure-pipelines

Copy link
Copy Markdown
Azure Pipelines:
2 pipeline(s) were filtered out due to trigger conditions.
There may be pipelines that require an authorized user to comment /azp run to run.

This branch has not been deployed

No deployments
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.

0 participants