Bump 1.3.0 and reduce scanner false positives#6
Merged
Conversation
There was a problem hiding this comment.
Pull request overview
This PR bumps ContractGuard to version 1.3.0 across the Python package and VS Code extension, and aims to reduce scanner false positives by skipping common build/vendor directories and suppressing some IP-address PII matches.
Changes:
- Add a shared
should_skip_path()helper and use it in the Secrets and PII analyzers’ file-loading logic. - Reduce PII false positives by skipping loopback/unspecified/reserved IP address matches.
- Bump version strings to 1.3.0 in Python packaging and VS Code extension metadata/scripts.
Reviewed changes
Copilot reviewed 6 out of 7 changed files in this pull request and generated 8 comments.
Show a summary per file
| File | Description |
|---|---|
| src/contractguard/analyzers/secrets_analyzer.py | Skip scanning files under excluded paths during secrets file loading. |
| src/contractguard/analyzers/pii_analyzer.py | Skip excluded paths during PII file loading; suppress select IP matches via _is_non_personal_ip. |
| src/contractguard/analyzers/file_filters.py | Introduce shared directory-skip helper for analyzers. |
| src/contractguard/init.py | Bump core package version to 1.3.0. |
| pyproject.toml | Bump Python package version to 1.3.0. |
| package.json | Bump VS Code extension version and packaging output filename to 1.3.0. |
| package-lock.json | Align lockfile root version to 1.3.0. |
💡 Add Copilot custom instructions for smarter, more guided reviews. Learn how to get started.
Comment on lines
+22
to
+25
|
|
||
|
|
||
| def should_skip_path(path: Path) -> bool: | ||
| return any(part in _SKIP_DIRS for part in path.parts) |
Comment on lines
117
to
120
| if path.is_dir(): | ||
| for f in sorted(path.rglob("*")): | ||
| if f.is_file() and f.suffix.lower() not in _SKIP_EXTENSIONS: | ||
| if f.is_file() and f.suffix.lower() not in _SKIP_EXTENSIONS and not should_skip_path(f): | ||
| try: |
Comment on lines
111
to
114
| if path.is_dir(): | ||
| for f in sorted(path.rglob("*")): | ||
| if f.is_file() and f.suffix.lower() not in _skip: | ||
| if f.is_file() and f.suffix.lower() not in _skip and not should_skip_path(f): | ||
| try: |
Comment on lines
70
to
+73
| matched = match.group(0) | ||
| if pii_name == "ip_address" and _is_non_personal_ip(matched): | ||
| continue | ||
| facts["pii_count"] += 1 |
| ip_value = ipaddress.ip_address(value) | ||
| except ValueError: | ||
| return False | ||
| return ip_value.is_loopback or ip_value.is_unspecified or ip_value.is_reserved |
Comment on lines
111
to
114
| if path.is_dir(): | ||
| for f in sorted(path.rglob("*")): | ||
| if f.is_file() and f.suffix.lower() not in _skip: | ||
| if f.is_file() and f.suffix.lower() not in _skip and not should_skip_path(f): | ||
| try: |
Comment on lines
117
to
120
| if path.is_dir(): | ||
| for f in sorted(path.rglob("*")): | ||
| if f.is_file() and f.suffix.lower() not in _SKIP_EXTENSIONS: | ||
| if f.is_file() and f.suffix.lower() not in _SKIP_EXTENSIONS and not should_skip_path(f): | ||
| try: |
Comment on lines
70
to
+73
| matched = match.group(0) | ||
| if pii_name == "ip_address" and _is_non_personal_ip(matched): | ||
| continue | ||
| facts["pii_count"] += 1 |
This file contains hidden or bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
Sign up for free
to join this conversation on GitHub.
Already have an account?
Sign in to comment
Add this suggestion to a batch that can be applied as a single commit.This suggestion is invalid because no changes were made to the code.Suggestions cannot be applied while the pull request is closed.Suggestions cannot be applied while viewing a subset of changes.Only one suggestion per line can be applied in a batch.Add this suggestion to a batch that can be applied as a single commit.Applying suggestions on deleted lines is not supported.You must change the existing code in this line in order to create a valid suggestion.Outdated suggestions cannot be applied.This suggestion has been applied or marked resolved.Suggestions cannot be applied from pending reviews.Suggestions cannot be applied on multi-line comments.Suggestions cannot be applied while the pull request is queued to merge.Suggestion cannot be applied right now. Please check back later.
No description provided.