Expand and fix auto-generated file filtering in is_valid_file()#2289
Open
PeterDaveHello wants to merge 1 commit intoqodo-ai:mainfrom
Open
Expand and fix auto-generated file filtering in is_valid_file()#2289PeterDaveHello wants to merge 1 commit intoqodo-ai:mainfrom
PeterDaveHello wants to merge 1 commit intoqodo-ai:mainfrom
Conversation
Split exact generated filenames from suffix matches so lockfiles are matched by basename, while generated assets such as minified files and source maps use suffix matching. Normalize path separators before basename matching so nested paths are handled consistently.
Contributor
Review Summary by QodoExpand auto-generated file filtering with lockfiles and assets
WalkthroughsDescription• Expanded lockfile detection with 8 additional package managers • Split exact filename matching from suffix-based filtering logic • Added minified and source map file filtering (.min.js, .min.css, .js.map, .ts.map, .css.map) • Normalized path separators for consistent nested path handling Diagramflowchart LR
A["is_valid_file function"] --> B["Check exact lockfile names"]
A --> C["Check generated asset suffixes"]
B --> D["Normalize path separators"]
D --> E["Match basename against set"]
C --> F["Match file endings"]
E --> G["Return False if matched"]
F --> G
File Changes1. pr_agent/algo/language_handler.py
|
Contributor
Code Review by Qodo
1. Single quotes in is_valid_file()
|
Comment on lines
+23
to
+32
| auto_generated_files_exact = { | ||
| 'package-lock.json', 'yarn.lock', 'pnpm-lock.yaml', 'composer.lock', 'Gemfile.lock', | ||
| 'poetry.lock', 'go.sum', '.terraform.lock.hcl', 'uv.lock', | ||
| 'Cargo.lock', 'Pipfile.lock', 'mix.lock', 'pubspec.lock', 'bun.lockb', | ||
| } | ||
| auto_generated_suffixes = ('.min.js', '.min.css', '.js.map', '.ts.map', '.css.map') | ||
| if filename.replace('\\', '/').split('/')[-1] in auto_generated_files_exact: | ||
| return False | ||
| if filename.endswith(auto_generated_suffixes): | ||
| return False |
Contributor
There was a problem hiding this comment.
1. Single quotes in is_valid_file() 📘 Rule violation ⚙ Maintainability
New string literals use single quotes, conflicting with the repo’s Ruff style requirement to prefer double quotes. This may cause CI/lint failures or inconsistent formatting across the codebase.
Agent Prompt
## Issue description
The new code in `is_valid_file()` introduces single-quoted string literals, but the repository Ruff style requires using double quotes for strings.
## Issue Context
This may trigger Ruff formatting/lint failures and creates inconsistent quoting style in the modified section.
## Fix Focus Areas
- pr_agent/algo/language_handler.py[23-32]
ⓘ Copy this prompt and use it to remediate the issue with your preferred AI generation tools
Contributor
Author
There was a problem hiding this comment.
This file already uses single quotes, and the current repo config does not enforce a specific quote style.
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.
Split exact generated filenames from suffix matches so lockfiles are matched by basename, while generated assets such as minified files and source maps use suffix matching. Normalize path separators before basename matching so nested paths are handled consistently.
GitHub Copilot PR summary: