Skip to content

Updates to scanner, PHP parser and lexer - #384

Merged
gazchap merged 6 commits into
milestone/5.0.6from
20260827--scanner-lexer-updates
Sep 3, 2026
Merged

gazchap merged 6 commits into
milestone/5.0.6from
20260827--scanner-lexer-updates

Conversation

@gazchap

@gazchap gazchap commented Aug 27, 2026

Copy link
Copy Markdown
Contributor

No description provided.

def _is_within_root(self, path: bytes) -> bool:
"""Return whether a resolved path is contained by the scan root."""
try:
return os.path.commonpath((self.root_path, path)) == self.root_path

Copy link
Copy Markdown
Contributor

Choose a reason for hiding this comment

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

note (non-blocking): root_path remains None until locate() initializes it. Today, search_directory() is only called by locate(), so the code is safe. A direct caller in the future that passes in a directory that contains a symlink could raise TypeError. Codex suggests making the method private or setting the value in __init__.

No change needed, but if you revisit the code from QA feedback, something to consider.

@gazchap
gazchap merged commit d559ca0 into milestone/5.0.6 Sep 3, 2026
10 checks passed
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.

2 participants