Skip to content

[DOC] ZlibCompression: drop stale QtByteArray reference; document all throws - #9334

Merged
timosachsenberg merged 1 commit into
developfrom
docs/ZlibCompression-doxygen
May 21, 2026
Merged

timosachsenberg merged 1 commit into
developfrom
docs/ZlibCompression-doxygen

Conversation

@timosachsenberg

@timosachsenberg timosachsenberg commented May 15, 2026 •

Copy link
Copy Markdown
Contributor

Summary

  • Drop stale reference: the existing class brief said "If you want safe conversions, use QtByteArray", but Qt has been removed from OpenMS core (#8965). Misleading; removed.
  • Add @ingroup FileIO.
  • Surface three throw paths on compressString / compressData that the previous docs were silent about: Exception::OutOfMemory (Z_MEM_ERROR), Exception::InvalidValue (Z_BUF_ERROR), Exception::ConversionError (any other zlib error). Verified against ZlibCompression.cpp:36-48.
  • Tighten uncompressData doc: spell out the two code paths (known vs unknown output_size); note the nr_bytes == 0 shortcut from ZlibCompression.cpp:55-58; note that the "actual size smaller than output_size" path resizes and logs informational (not a throw) -- ZlibCompression.cpp:64-71.
  • Promote uncompressString from a one-line "Convencience" (typo) summary to a proper Doxygen block that delegates @throws to uncompressData.

No behaviour change.

Test plan

  • cmake --build OpenMS-build --target OpenMS builds cleanly.
  • CI Doxygen warning check passes (Linux).

🤖 Generated with Claude Code

Summary by CodeRabbit

Documentation

  • Enhanced documentation for compression and decompression utilities with clarified input/output semantics, supported/unsupported format details, exception type mappings, and optional parameter behaviors in different allocation scenarios.

Review Change Stack

… throws

- Drop the "If you want safe conversions, use QtByteArray" line -- Qt
  has been removed from OpenMS core (PR #8965), the reference is stale
  and misleading.
- Add @InGroup FileIO.
- Surface the three throw paths on compressString / compressData
  (OutOfMemory, InvalidValue, ConversionError), verified against
  ZlibCompression.cpp:36-48.
- Tighten the uncompressData doc: spell out the two code paths (known
  vs unknown output size) and document the nr_bytes==0 shortcut
  (ZlibCompression.cpp:55-58). Note that the "actual size smaller than
  output_size" path resizes and logs informational (not a throw)
  (ZlibCompression.cpp:64-71).
- Promote uncompressString from a one-line "Convencience" (typo)
  summary to a proper block that delegates @throws to uncompressData.

No behaviour change.

Co-Authored-By: Claude Opus 4.7 (1M context) <[email protected]>
@coderabbitai

coderabbitai Bot commented May 15, 2026

Copy link
Copy Markdown
Contributor

No actionable comments were generated in the recent review. 🎉

ℹ️ Recent review info
⚙️ Run configuration

Configuration used: Organization UI

Review profile: CHILL

Plan: Pro

Run ID: 74b88a57-62ca-431a-8779-f0cd2d763926

📥 Commits

Reviewing files that changed from the base of the PR and between e588e54 and 43f6166.

📒 Files selected for processing (1)
  • src/openms/include/OpenMS/FORMAT/ZlibCompression.h

📝 Walkthrough

Walkthrough

This PR updates the Doxygen documentation for the ZlibCompression class in a single header file. The changes clarify raw-byte handling, input/output semantics, supported formats (zlib only, rejecting gzip), the optional output_size behavior for iterative decompression, and exception types corresponding to specific failure conditions.

Changes

ZlibCompression API Documentation

Layer / File(s) Summary
Compression and decompression API documentation
src/openms/include/OpenMS/FORMAT/ZlibCompression.h
Class-level documentation expanded with raw-byte semantics and @ingroup FileIO tag. Method documentation for compressString, compressData, uncompressData, and uncompressString rewrote parameter/return descriptions, clarified optional output_size behavior (direct vs. iterative chunked decompression), explicitly documented gzip rejection on decompression, and mapped documented exceptions to specific failure cases.

Suggested reviewers

  • jpfeuffer

Poem

🐰 A Doc's Tale

Bytes compressed, now crystal clear,
Doxygen words the reviewers hear—
What zlib does, what it won't touch,
(gzip-framed streams, we don't like much),
Exceptions mapped, semantics bright,
Documentation done just right! 📚✨

🚥 Pre-merge checks | ✅ 4 | ❌ 1

❌ Failed checks (1 warning)

Check name Status Explanation Resolution
Docstring Coverage ⚠️ Warning Docstring coverage is 50.00% which is insufficient. The required threshold is 80.00%. Write docstrings for the functions missing them to satisfy the coverage threshold.
✅ Passed checks (4 passed)
Check name Status Explanation
Description Check ✅ Passed Check skipped - CodeRabbit’s high-level summary is enabled.
Title check ✅ Passed The title accurately reflects the main changes: removing a stale QtByteArray reference and documenting exception throws in ZlibCompression Doxygen docs.
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 docs/ZlibCompression-doxygen

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.

@timosachsenberg
timosachsenberg merged commit 9b72b6c into develop May 21, 2026
44 checks passed
@timosachsenberg
timosachsenberg deleted the docs/ZlibCompression-doxygen branch May 21, 2026 06:05
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.

1 participant