Skip to content

chore: clang-format two over-long QVERIFY2 lines in tst_integration.cpp#1475

Merged
annejan merged 1 commit into
mainfrom
fix/clang-format-tst-integration
May 13, 2026
Merged

chore: clang-format two over-long QVERIFY2 lines in tst_integration.cpp#1475
annejan merged 1 commit into
mainfrom
fix/clang-format-tst-integration

Conversation

@annejan

@annejan annejan commented May 13, 2026

Copy link
Copy Markdown
Member

Summary

CI super-linter started rejecting unrelated PRs because clang-format runs over the whole tree and two lines in `tst_integration.cpp` exceed the 80-col limit:

```
/github/workspace/tests/auto/integration/tst_integration.cpp:430:67: error: code should be clang-formatted [-Wclang-format-violations]
QVERIFY2(bytesWritten1 == static_cast(strlen(payload1)), "failed to write test payload to c1");
^
/github/workspace/tests/auto/integration/tst_integration.cpp:436:48: error: code should be clang-formatted [-Wclang-format-violations]
QVERIFY2(bytesWritten2 == corruptData.size(), "failed to write test payload to c2");
^
```

Those came from CodeRabbit's auto-fix on #1471 that captured the `QFile::write()` return value and asserted it equals the payload size. The change was good, the formatting just slipped past.

Reformat both calls — break after the condition, matches the QVERIFY2 style applied elsewhere.

Test plan

  • `clang-format` re-runs cleanly on the file
  • `tests/auto/integration/tst_integration imitatePass_grepSkipsUndecryptableFiles` — passes

🤖 Generated with Claude Code

Summary by CodeRabbit

  • Tests
    • Improved test code formatting in integration tests.

Note: This release contains no user-visible changes. Updates are limited to internal test code formatting.

Review Change Stack

CodeRabbit's auto-fix on #1471 captured the QFile::write() return value
and asserted it equals the payload size — sensible nit. The resulting
QVERIFY2 calls busted the 80-col limit and the super-linter is rejecting
unrelated PRs (#1474 head was 7430a35) because clang-format runs over
the whole tree.

Reformat both calls — break after the condition, matches the style of
all the other QVERIFY2 sites added in earlier security PRs.

No semantic change.

Co-Authored-By: Claude Opus 4.7 (1M context) <noreply@anthropic.com>
@coderabbitai

coderabbitai Bot commented May 13, 2026

Copy link
Copy Markdown
Contributor

No actionable comments were generated in the recent review. 🎉

ℹ️ Recent review info
⚙️ Run configuration

Configuration used: Repository UI (base), Organization UI (inherited)

Review profile: ASSERTIVE

Plan: Pro

Run ID: dd480b53-2e23-4490-b078-09d8b3f08a41

📥 Commits

Reviewing files that changed from the base of the PR and between f76afff and 035eb71.

📒 Files selected for processing (1)
  • tests/auto/integration/tst_integration.cpp

📝 Walkthrough

Walkthrough

A single-line QVERIFY2 assertion in the imitatePass_grepSkipsUndecryptableFiles() integration test is reformatted to span multiple lines, improving readability without altering the validation logic.

Changes

Test assertion formatting

Layer / File(s) Summary
Test assertion line formatting
tests/auto/integration/tst_integration.cpp
The QVERIFY2 assertion checking bytesWritten2 == corruptData.size() is reformatted across multiple lines; test logic and validation behavior remain unchanged.

Estimated code review effort

🎯 1 (Trivial) | ⏱️ ~2 minutes

Possibly related PRs

  • IJHack/QtPass#1185: Both PRs touch the same integration test file with assertion formatting and cleanup changes.
  • IJHack/QtPass#1471: Introduced the imitatePass_grepSkipsUndecryptableFiles() test that contains the assertion being reformatted in this PR.

Poem

A line too long, a rabbit's woe—
So split it wide, let readability flow.
Each QVERIFY now spans with grace,
Assertions clearer, fitting their space. 🐰✨

🚥 Pre-merge checks | ✅ 5
✅ Passed checks (5 passed)
Check name Status Explanation
Description Check ✅ Passed Check skipped - CodeRabbit’s high-level summary is enabled.
Title check ✅ Passed The title directly and specifically describes the main change: reformatting two QVERIFY2 lines in tst_integration.cpp to comply with clang-format's 80-column rule.
Docstring Coverage ✅ Passed Docstring coverage is 100.00% which is sufficient. The required threshold is 80.00%.
Linked Issues check ✅ Passed Check skipped because no linked issues were found for this pull request.
Out of Scope Changes check ✅ Passed Check skipped because no linked issues were found for this pull request.

✏️ Tip: You can configure your own custom pre-merge checks in the settings.

✨ Finishing Touches
📝 Generate docstrings
  • Create stacked PR
  • Commit on current branch
🧪 Generate unit tests (beta)
  • Create PR with unit tests
  • Commit unit tests in branch fix/clang-format-tst-integration

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.

❤️ Share

Comment @coderabbitai help to get the list of available commands and usage tips.

@coveralls

Copy link
Copy Markdown

Coverage Status

coverage: 29.081% (-0.03%) from 29.111% — fix/clang-format-tst-integration into main

@codecov

codecov Bot commented May 13, 2026

Copy link
Copy Markdown

Codecov Report

✅ All modified and coverable lines are covered by tests.
✅ Project coverage is 34.38%. Comparing base (f76afff) to head (035eb71).
⚠️ Report is 1 commits behind head on main.
✅ All tests successful. No failed tests found.

Additional details and impacted files
@@            Coverage Diff             @@
##             main    #1475      +/-   ##
==========================================
- Coverage   34.43%   34.38%   -0.05%     
==========================================
  Files          44       44              
  Lines        4385     4385              
==========================================
- Hits         1510     1508       -2     
- Misses       2875     2877       +2     
Flag Coverage Δ
qtpass 34.38% <ø> (-0.05%) ⬇️

Flags with carried forward coverage won't be shown. Click here to find out more.

☔ View full report in Codecov by Sentry.
📢 Have feedback on the report? Share it here.

@annejan
annejan merged commit e845f01 into main May 13, 2026
26 of 27 checks passed
@annejan
annejan deleted the fix/clang-format-tst-integration branch May 13, 2026 22:25
Sign up for free to join this conversation on GitHub. Already have an account? Sign in to comment

Labels

None yet

Projects

None yet

Development

Successfully merging this pull request may close these issues.

2 participants