Skip to content

Rust: support glob members in workspaces #18802

New issue

Have a question about this project? Sign up for a free GitHub account to open an issue and contact its maintainers and the community.

By clicking “Sign up for GitHub”, you agree to our terms of service and privacy statement. We’ll occasionally send you account related emails.

Already on GitHub? Sign in to your account

Merged
merged 1 commit into from
Feb 19, 2025
Merged

Conversation

redsun82
Copy link
Contributor

No description provided.

@redsun82 redsun82 requested review from aibaars and Copilot February 17, 2025 14:11
@github-actions github-actions bot added the Rust Pull requests that update Rust code label Feb 17, 2025
Copy link
Contributor

@Copilot Copilot AI left a comment

Choose a reason for hiding this comment

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

PR Overview

This pull request adds support for glob members in Rust workspaces. The changes include new integration test files, updates to Cargo.toml files for workspace configuration, and modifications in the Rust analyzer extractor to incorporate glob matching for workspace members and exclusion logic.

  • Added a simple executable and library to test workspace globs.
  • Updated Cargo.toml files to define workspace members with glob patterns and exclusions.
  • Modified rust_analyzer.rs to add a new helper function for glob pattern matching and updated workspace detection accordingly.
  • Provided a basic Python integration test for workspace functionality.

Changes

File Description
rust/ql/integration-tests/workspace-with-glob/exe/src/main.rs Added main file invoking the library function.
rust/ql/integration-tests/workspace-with-glob/exe/Cargo.toml Configured executable package with dependency on lib.
rust/ql/integration-tests/workspace-with-glob/lib/Cargo.toml Configured library package.
rust/ql/integration-tests/workspace-with-glob/other/Cargo.toml Configured an additional package to be excluded from the workspace.
rust/ql/integration-tests/workspace-with-glob/Cargo.toml Set up the workspace using glob members and exclude directives.
rust/ql/integration-tests/workspace-with-glob/test_workspace.py Added integration test to verify workspace processing.
rust/ql/integration-tests/workspace-with-glob/lib/src/lib.rs Provided the library function used by the executable.
rust/extractor/src/rust_analyzer.rs Introduced functionality for matching workspace members with glob patterns and updated workspace detection accordingly.

Copilot reviewed 12 out of 12 changed files in this pull request and generated 1 comment.

Tip: Copilot only keeps its highest confidence comments to reduce noise and keep you focused. Learn more

@redsun82
Copy link
Contributor Author

DCA looks good, with some projects benefiting particularly from this. We get one more missing call target for rust, but I would accept that.

Copy link
Contributor

@aibaars aibaars left a comment

Choose a reason for hiding this comment

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

This looks good to me, but have you checked that this works as expected on Windows? I believe * characters are not allowed in paths, and it might be that the Path type performs some OS specific checks.

We may also want to ensure a Pattern is only "compiled" once instead of creating patterns inside a loop.

@redsun82 redsun82 merged commit 3c00dc4 into main Feb 19, 2025
15 checks passed
@redsun82 redsun82 deleted the redsun82/rust-glob-members branch February 19, 2025 12:31
Sign up for free to join this conversation on GitHub. Already have an account? Sign in to comment
Labels
Rust Pull requests that update Rust code
Projects
None yet
Development

Successfully merging this pull request may close these issues.

2 participants