Skip to content

[DOC] ZipIfstream: surface NotImplemented-without-libzip; @ingroup FileIO; tighten contracts - #9345

Merged
timosachsenberg merged 1 commit into
developfrom
docs/ZipIfstream-doxygen
May 19, 2026
Merged

timosachsenberg merged 1 commit into
developfrom
docs/ZipIfstream-doxygen

Conversation

@timosachsenberg

@timosachsenberg timosachsenberg commented May 15, 2026 •

Copy link
Copy Markdown
Contributor

Summary

  • Surface previously-undocumented Exception::NotImplemented that open() and read() raise when OpenMS is built without libzip (ZipIfstream.cpp:100-104, :135-139). The default constructor, close(), isOpen() and streamEnd() remain usable even without libzip.
  • Add @ingroup FileIO (matches Bzip2Ifstream).
  • Tighten the class brief: lifecycle (construct/open -> read until short return -> auto-close) and the fact that copy and move are deliberately suppressed.
  • read(): document the n == 0 no-op shortcut (ZipIfstream.cpp:110-113); promote @exception tags to @throws; cover all three exception types.
  • open(): tighten the existing @exception list with grounded sources (FileNotFound when missing, FileNotReadable for archive-open / entry-open failure, FileEmpty when zero non-directory entries, ParseError when more than one).
  • Add ///< field docs explaining why the libzip handles are typed as void* and what stream_at_end_ means.

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 internal documentation for file streaming components with clarified descriptions of streaming behavior, exception handling, and state management semantics.

Review Change Stack

…leIO; tighten contracts

- Surface the previously-undocumented Exception::NotImplemented that
  open() and read() raise when OpenMS is built without libzip
  (ZipIfstream.cpp:100-104 / :135-139). The default constructor,
  close(), isOpen() and streamEnd() remain usable even without libzip.
- Add @InGroup FileIO (matches Bzip2Ifstream).
- Tighten the class brief to describe the lifecycle (construct/open ->
  read until short return -> auto-close) and that copy and move are
  deliberately suppressed.
- read(): document the n==0 no-op shortcut (ZipIfstream.cpp:110-113);
  promote @exception tags to @throws; cover all three exception types.
- open(): tighten the existing @exception list with grounded sources
  (FileNotFound when missing, FileNotReadable for archive open or
  entry open failure, FileEmpty when zero non-directory entries,
  ParseError when more than one).
- Add ///< field docs explaining why the libzip handles are typed as
  void* (to keep zip.h out of the public header) and what
  stream_at_end_ means.

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: c29c13fb-c897-46dc-a9ec-8e23c7a3a1e8

📥 Commits

Reviewing files that changed from the base of the PR and between 2de6a69 and 29e0d4a.

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

📝 Walkthrough

Walkthrough

This PR updates the Doxygen documentation for the ZipIfstream class header, expanding clarifications around streaming behavior, closure semantics, exception handling, copy/move suppression, and internal member state meaning. No code logic changes occur.

Changes

ZipIfstream Documentation Enhancement

Layer / File(s) Summary
Public API behavior and semantics documentation
src/openms/include/OpenMS/FORMAT/ZipIfstream.h (lines 17–119)
Expanded Doxygen comments for the class, constructors, read, streamEnd, isOpen, open, and close methods now describe streaming/closure behavior, exception conditions (including NotImplemented when built without libzip), and clarify that copy and move semantics are suppressed.
Internal member state documentation
src/openms/include/OpenMS/FORMAT/ZipIfstream.h (lines 128–130)
Replaced inline comments for zip_archive_, zip_entry_, and stream_at_end_ with detailed Doxygen annotations explaining opaque libzip handle types and the meaning of the stream-at-end state flag.

Possibly related PRs

  • OpenMS/OpenMS#9139: The main PR that introduced the ZipIfstream class implementation; this documentation update directly clarifies its public API and internal state.

Suggested reviewers

  • jpfeuffer
  • pjones

Poem

🐰 A rabbit reads docs with careful delight,
Each comment now clearer, each detail made right,
The streaming semantics and state flags so fine,
Now documented boldly—libzip's design!

🚥 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 clearly and specifically summarizes the main change: documentation improvements to ZipIfstream including NotImplemented exception surfacing, FileIO grouping, and contract tightening.
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/ZipIfstream-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 cacbc78 into develop May 19, 2026
44 checks passed
@timosachsenberg
timosachsenberg deleted the docs/ZipIfstream-doxygen branch May 19, 2026 19:15
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