Conversation
|
No actionable comments were generated in the recent review. 🎉 ℹ️ Recent review info⚙️ Run configurationConfiguration used: defaults Review profile: CHILL Plan: Pro Plus Run ID: 📒 Files selected for processing (5)
🚧 Files skipped from review as they are similar to previous changes (1)
Included review availability: Your plan provides up to 4 included reviews per hour; 3 remain after this review. 📝 WalkthroughWalkthroughThe ChangesInclude-subdirectory behavior
Estimated code review effort: 2 (Simple) | ~10 minutes Merge Risk: ⚪ Minimal · up to This change narrowly allows valid top-level header includes while preserving existing checks for nested sources and related diagnostics. The supplied tests and checks pass, and no actionable merge-blocking risk remains beyond normal review. Suggested reviewers: 🚥 Pre-merge checks | ✅ 4 | ❌ 1❌ Failed checks (1 warning)
✅ Passed checks (4 passed)
Full details: Docstring CoverageExplanation Docstring coverage is 33.33% which is insufficient. The required threshold is 80.00%. Docstring coverage is scoped to functions touched by this diff. Analyzed 3 functions across 2 files. (3 skipped: 3 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 |
walidbi200
left a comment
There was a problem hiding this comment.
Reviewed current head 1592d0b. The normal #375 case is fixed and the tests are green, but I found two path-handling cases that seem important to fix before merging.
One is a source path that goes through a symlink and then ... In that case cpplint can open one real file, while FileInfo.FullName() normalizes the path to a different lexical directory. The new same-directory header check can then look beside the wrong path. I reproduced both outcomes: it can warn even when the real sibling header exists, and it can suppress the warning when only an unrelated header exists in the normalized directory.
The other case is self-includes through filesystem aliases. If self.h includes alias.h and alias.h is a symlink or hard link to self.h, develop still reports build/include_subdir, but this PR suppresses it. os.path.samefile() confirms the two paths refer to the same file. The current normpath() / normcase() comparison only compares path strings, so it doesn't catch that identity case.
I also checked the ordinary same-directory behavior, missing headers, the sample-output changes, and the full test suite; those parts look good. I think these two filesystem cases should get regression tests and a fix before merge.
Fixes #375.
Summary
build/include_subdirbuild/include_subdirenforcement when the bare header does not resolve locally, and keep self-includes subject to the existing warningTesting
src/main.cpp+src/utils.hppfalse positive from False positive for top-level header #375pytest --no-cov cpplint_unittest.py -k testBuildInclude: passed after the fixpylint cpplint.py: passed