GeezerVisonThe World Wide Web, restored to 800 pixels of glory. | |||||||||||||||||||||||||||||||
| Home|About|Gaming cabinet|Archives|How it works|Starter sites | |||||||||||||||||||||||||||||||
GeezerVison is showing github.com — fix: match exclude_files against relative paths by yangfan-yf-yf · Pull Request #463 · cpplint/cpplint Conversation
|
|
No actionable comments were generated in the recent review. 🎉 ℹ️ Recent review info⚙️ Run configurationConfiguration used: defaults Review profile: CHILL Plan: Advanced Run ID: 📒 Files selected for processing (3)
🚧 Files skipped from review as they are similar to previous changes (2)
Included review availability: Your plan provides up to 4 included reviews per hour; 3 remain after this review. 📝 WalkthroughWalkthrough
ChangesRelative
Priority: ➖ Normal Estimated code review effort: 3 (Moderate) | ~20 minutes Change: Bug fix · Severity of issue fixed: Medium Suggested reviewers: Merge Risk: ⚪ Minimal · up to The relative exclusion matching change and its inheritance, quiet-mode, and diagnostic behavior are covered by the provided implementation and test context. No merge-blocking risk is identified. 🚥 Pre-merge checks | ✅ 4 | ❌ 1❌ Failed checks (1 warning)
✅ Passed checks (4 passed)
Full details: Docstring CoverageExplanation Docstring coverage is 12.50% which is insufficient. The required threshold is 80.00%. Docstring coverage is scoped to functions touched by this diff. Analyzed 8 functions across 2 files. (1 skipped: 1 unsupported.)
✨ Finishing Touches🧪 Generate unit tests (beta)
Thanks for using CodeRabbit! It's free for OSS, and your support helps us grow. If you like it, consider giving us a shout-out. Comment |
Sorry, something went wrong.
There was an error while loading. Please reload this page.
There was a problem hiding this comment.
The reason will be displayed to describe this comment to others. Learn more.
Actionable comments posted: 1
Verify each finding against current code. Fix only still-valid issues, skip the
rest with a brief reason, keep changes minimal, and validate.
Inline comments:
In `@cpplint.py`:
- Around line 270-273: Document in the exclude_files path-matching guidance in
cpplint.py (lines 270-273) that anchored directory patterns must be changed from
^bar$ to ^bar/. Add ("bar/baz.cc", "^bar$", True) to the relevant compatibility
test cases in cpplint_unittest.py (lines 7295-7302) to lock the behavior that
^bar$ does not exclude the bar subtree.
Fix all unresolved CodeRabbit comments on this PR:
Configuration used: defaults
Review profile: CHILL
Plan: Pro Plus
Run ID: 68156488-6931-42bb-9d53-40dde9ee4fd0
CHANGELOG.rstcpplint.pycpplint_unittest.py
Sorry, something went wrong.
There was an error while loading. Please reload this page.
There was an error while loading. Please reload this page.
There was a problem hiding this comment.
The reason will be displayed to describe this comment to others. Learn more.
Re-reviewed current head db3dfc9. The implementation consistently matches exclude_files against the path relative to the defining CPPLINT.cfg, normalizes separators, preserves parent traversal and set noparent, and documents/tests the anchored-directory compatibility boundary (^bar$ vs ^bar/). The prior review finding about that boundary is addressed on this head. The PR reports 7 focused configuration tests and 238 full-suite tests passing, together with Ruff, Mypy, Pylint, Codespell, and git diff --check. LGTM.
Sorry, something went wrong.
There was an error while loading. Please reload this page.
There was a problem hiding this comment.
The reason will be displayed to describe this comment to others. Learn more.
Reviewed current head db3dfc9. The relative-path accumulation itself looks correct, including nested configs, parent traversal, set noparent, and the documented ^bar$ / ^bar/ behavior. The focused and full suites also pass.
I did find one case in the newly supported full-path matching that crashes instead of excluding the file. If a matched path contains %, the non-quiet exclusion message is later passed through % string formatting, so percent sequences that came from the filename can be interpreted as format directives.
For example, with a file at percent%2f/baz.cc and:
exclude_files=^percent%2f/baz[.]cc$
this PR matches the new relative path as intended, but then exits with TypeError: must be real number, not str while printing the exclusion notice. With --quiet it excludes correctly.
The formatting weakness already exists in the old message path, but this PR makes it reachable through the newly supported nested-path matching and also changes that diagnostic. I think it would be worth making the message formatting safe and adding a non-quiet %-path regression before merge.
Other than that, the relative-path behavior held up in my testing.
Sorry, something went wrong.
There was an error while loading. Please reload this page.
|
Fixed in d736a62. I reproduced the non-quiet I added six regression cases covering percent characters in the target path, configuration directory, and pattern, with both quiet and non-quiet output checks. The same CLI example now exits successfully and preserves the complete literal diagnostic; quiet mode remains silent. Validation on Windows / Python 3.12.3: 244 tests passed, coverage 96.75%; Mypy, Pylint, pre-commit on the three changed files, and |
Sorry, something went wrong.
There was an error while loading. Please reload this page.
There was a problem hiding this comment.
The reason will be displayed to describe this comment to others. Learn more.
Re-reviewed current head d736a62. My previous %-path blocker is fixed.
I reproduced the original percent%2f/baz.cc failure on the previous head and confirmed it now exits cleanly while preserving the literal diagnostic. The new regression coverage exercises percent characters in the target path, config directory, and pattern in both quiet and non-quiet modes.
I also checked the focused config tests, full suite, pylint, mypy, pre-commit, and git diff --check; all passed locally. No remaining blocker from me on this head. LGTM.
Sorry, something went wrong.
There was an error while loading. Please reload this page.
At least 1 approving review is required to merge this pull request.
There was an error while loading. Please reload this page.
Successfully merging this pull request may close these issues.
Allow exclude_files option in the config file to exclude a specific file in a subdirectory
There was an error while loading. Please reload this page.