Repository navigation
Conversation
Trace continued lines to their directive before applying the standalone brace warning. Preserve the existing checks for ordinary continued code. Fixes cpplint#294.
|
No actionable comments were generated in the recent review. Walkthrough
Merge Risk:
|
Csq57
left a comment
There was a problem hiding this comment.
I independently reviewed PR #480 at pinned head d3f4003 against develop (926bf4b), using GitHub-hosted Ubuntu, Windows, and macOS with Python 3.12 and 3.15.1 (pytest==9.1.1).
Full-suite comparison (consistent across all three operating systems):
Source | Python 3.12 | Python 3.15.1 -- | -- | -- Base develop | 231 passed | 227 passed, 4 failed PR #480 | 238 passed | 234 passed, 4 failedI also ran independent CheckBraces reproductions. Two- and three-line OpenMP directives produce the unwanted whitespace/braces warning on the base but not on this PR. Single-line pragmas remain unaffected, while ordinary if statements, continued if conditions, and separate if statements following pragmas still report the expected warning.
The four Python 3.15.1 failures are identical on the base and PR branches and involve the existing os.path.commonprefix() deprecation warnings. They are unrelated to this PR's changes.
One non-blocking observation: the continuation logic also exempts braces following multiline #define directives. This appears consistent with the checker's existing exemption for immediately preceding preprocessor directives, but an additional regression test could document the intended behavior.
Independent evidence:
https://github.com/Csq57/ai-python-repository-stabilization-case-study/actions/runs/40453763938
The comparison workflow passed, but the Python 3.15.1 pytest runs themselves retained their four known failures.
This review was prepared with AI assistance and grounded in actual independent CI executions.
Approved for the scoped Issue #294 fix based on the tested head.
|
I checked the current merge conflict and prepared an optional merge commit on this branch, with parents Only |
…e-preprocessor-braces # Conflicts: # CHANGELOG.rst
A brace on its own line is allowed after a preprocessor directive, but the check only looks at its last physical line. Splitting an OpenMP pragma with a backslash therefore produces a
whitespace/braceswarning.Follow line continuations back to the start of the directive. The other checks still use the original preceding line. Regression cases cover two- and three-line pragmas, comments and blank lines, and ordinary code that must continue to warn.
Fixes #294.
Validation: 238 tests passed with 96.47% coverage on Python 3.12; Ruff check/format, pylint, and mypy passed. The new regression cases fail on the base revision and pass with the fix.
Summary by CodeRabbit
ifstatement, so the exception does not hide unrelated warnings.