-
Notifications
You must be signed in to change notification settings - Fork 36
Closed
Labels
bugIssue identified by VS Code Team member as probable bugIssue identified by VS Code Team member as probable bugneeds PR
Description
Problem
The regex pattern used to identify Poetry environments by name is slightly permissive and could potentially match non-Poetry environments.
Current Code
// pet-poetry/src/lib.rs L32
static ref POETRY_ENV_NAME_PATTERN: Regex = Regex::new(r"^.+-[A-Za-z0-9_-]{8}-py.*$")Issue
Poetry uses a specific naming convention: {name}-{8-char-hash}-py{major}.{minor}
The current pattern:
- Uses
py.*$which would matchpy,pyxyz,py3, etc. - Should be more specific to match
py{major}.{minor}format
Expected Pattern
Poetry's actual naming pattern creates names like:
myproject-AbCdEf12-py3.10demo-project-XyZ78901-py3.11
A more precise pattern would be:
r"^.+-[A-Za-z0-9_-]{8}-py\d+\.\d+$"Impact
Low - but could cause false positives in edge cases where a non-Poetry virtualenv happens to have a name matching the loose pattern.
Affected File
crates/pet-poetry/src/lib.rs
Reactions are currently unavailable
Metadata
Metadata
Assignees
Labels
bugIssue identified by VS Code Team member as probable bugIssue identified by VS Code Team member as probable bugneeds PR