Skip to content

Reduce scope of regex in PowerShellExeFinder #5228

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

Open
wants to merge 1 commit into
base: main
Choose a base branch
from

Conversation

tsmarvin
Copy link

PR Summary

  • Update integer checking regex to match implied expectations from related comments.
    • While reading through the comments associated with the IntRegex value it is implied that we're only looking for single digit integer folders. This update formally matches that implied expectation.

PR Checklist

Note: Tick the boxes below that apply to this pull request by putting an x between the square brackets.
Please mark anything not applicable to this PR NA.

  • PR has a meaningful title
  • Summarized changes
  • PR has tests
  • This PR is ready to merge and is not work in progress
    • If the PR is work in progress, please add the prefix WIP: to the beginning of the title and remove the prefix when the PR is ready

@Copilot Copilot AI review requested due to automatic review settings June 29, 2025 12:16
Copy link

@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.

Pull Request Overview

This PR updates the integer checking regex in the PowerShellExeFinder to enforce a stricter validation by matching exactly a single digit rather than one or more digits.

  • Change the IntRegex from matching one or more digits (/^\d+$/) to exactly one digit (/^\d$/).
  • This adjustment aligns the implementation with the implied expectation from related comments regarding folder naming.
Comments suppressed due to low confidence (1)

src/platform.ts:81

  • Consider updating the associated comment to clearly state that the regex now only supports single digit folder names, ensuring that the documentation is consistent with the updated regex behavior.
    private static IntRegex = /^\d$/;

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.

1 participant