Skip to content

Added documentation to MiniExcelConverter and fixed warnings in tests and benchmarks projects#986

Merged
michelebastione merged 3 commits into
mini-software:masterfrom
michelebastione:improved-docs
Jul 20, 2026
Merged

Added documentation to MiniExcelConverter and fixed warnings in tests and benchmarks projects#986
michelebastione merged 3 commits into
mini-software:masterfrom
michelebastione:improved-docs

Conversation

@michelebastione

@michelebastione michelebastione commented Jul 20, 2026

Copy link
Copy Markdown
Collaborator

As per the title, this PR adds the long overdue documentation to the MiniExcelConverter utility class and makes a few small changes that finally fix all warnings in the tests and benchmark projects (mostly nullable reference types checks).

Summary by CodeRabbit

  • Bug Fixes
    • Improved asynchronous cleanup during picture processing.
    • Enhanced stream handling for CSV↔XLSX conversions, including safer disposal of temporary resources.
    • Updated converter docs to clarify that stream-based conversion methods do not close the provided streams.
  • Tests
    • Strengthened CSV and OpenXML tests for nullable values and optional results to reduce brittle assumptions.
    • Adjusted CSV test casting to fail fast on incompatible runtime types.
  • Chores
    • Enabled the benchmark license acceptance setting.

@coderabbitai

coderabbitai Bot commented Jul 20, 2026

Copy link
Copy Markdown

Review Change Stack

No actionable comments were generated in the recent review. 🎉

ℹ️ Recent review info
⚙️ Run configuration

Configuration used: defaults

Review profile: CHILL

Plan: Pro

Run ID: a86c472c-f7ef-492f-b1d6-d9c2a93c59a3

📥 Commits

Reviewing files that changed from the base of the PR and between e187dff and c35969f.

📒 Files selected for processing (2)
  • src/MiniExcel.Core/Helpers/FileHelper.cs
  • src/MiniExcel/MiniExcelConverter.cs
🚧 Files skipped from review as they are similar to previous changes (1)
  • src/MiniExcel/MiniExcelConverter.cs

📝 Walkthrough

Walkthrough

The changes update CSV/XLSX conversion stream disposal, OpenXML reader disposal, benchmark license configuration, nullable assumptions in CSV and OpenXML tests, and formatting in a file-opening helper.

Changes

Converter and async disposal

Layer / File(s) Summary
Converter stream lifecycle
src/MiniExcel/MiniExcelConverter.cs
File-path overloads conditionally use synchronous or asynchronous stream disposal; stream overloads preserve caller-owned streams and retain CSV/XLSX conversion behavior.
Picture reader async disposal
src/MiniExcel.OpenXml/Picture/OpenXmlPictureImplement.cs
AddPictureAsync now disposes the OpenXML reader with await using.

Benchmark configuration and nullable test models

Layer / File(s) Summary
Nullable test expectations
tests/MiniExcel.Csv.Tests/Main/*, tests/MiniExcel.OpenXml.Tests/...
Tests use nullable model members and extracted results, explicit dictionary casts, and null-safe mapping assertions.
Benchmark license setting
benchmarks/MiniExcel.Benchmarks/MiniExcel.Benchmarks.csproj
The benchmarks project enables AcceptNPOIOSMFLicense.

Helper formatting

Layer / File(s) Summary
File helper formatting
src/MiniExcel.Core/Helpers/FileHelper.cs
OpenSharedRead is reformatted without changing its file-opening behavior.

Estimated code review effort: 2 (Simple) | ~10 minutes

🚥 Pre-merge checks | ✅ 4 | ❌ 1

❌ Failed checks (1 warning)

Check name Status Explanation Resolution
Docstring Coverage ⚠️ Warning Docstring coverage is 0.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: MiniExcelConverter documentation and warning fixes in tests and benchmarks.
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.
✨ Finishing Touches
🧪 Generate unit tests (beta)
  • Create PR with unit tests

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

@coderabbitai coderabbitai Bot left a comment

Copy link
Copy Markdown

Choose a reason for hiding this comment

The reason will be displayed to describe this comment to others. Learn more.

Actionable comments posted: 2

🤖 Prompt for all review comments with AI agents
Verify each finding against current code. Fix only still-valid issues, skip the
rest with a brief reason, keep changes minimal, and validate.

Inline comments:
In `@src/MiniExcel/MiniExcelConverter.cs`:
- Around line 26-34: Register each acquired stream for disposal immediately
before opening the next stream: in src/MiniExcel/MiniExcelConverter.cs lines
26-34, dispose csvStream before constructing xlsxStream; in
src/MiniExcel/MiniExcelConverter.cs lines 78-86, dispose xlsxStream before
constructing csvStream. Preserve the existing SYNC_ONLY and asynchronous
disposal behavior.
- Around line 92-94: Update the XML summary for the affected conversion method
to describe XLSX-to-CSV conversion: it reads XLSX data from the input stream and
writes CSV data to the output stream asynchronously.
🪄 Autofix (Beta)

Fix all unresolved CodeRabbit comments on this PR:

  • Push a commit to this branch (recommended)
  • Create a new PR with the fixes

ℹ️ Review info
⚙️ Run configuration

Configuration used: defaults

Review profile: CHILL

Plan: Pro

Run ID: c8cca028-bc61-4208-b876-a3f6578c1760

📥 Commits

Reviewing files that changed from the base of the PR and between 3266e8b and e187dff.

📒 Files selected for processing (8)
  • benchmarks/MiniExcel.Benchmarks/MiniExcel.Benchmarks.csproj
  • src/MiniExcel.OpenXml/Picture/OpenXmlPictureImplement.cs
  • src/MiniExcel/MiniExcelConverter.cs
  • tests/MiniExcel.Csv.Tests/Main/MiniExcelCsvTests.cs
  • tests/MiniExcel.Csv.Tests/Main/Models.cs
  • tests/MiniExcel.OpenXml.Tests/FluentMapping/MiniExcelMappingTests.cs
  • tests/MiniExcel.OpenXml.Tests/Templates/InputValueExtractorTests.cs
  • tests/MiniExcel.OpenXml.Tests/Templates/Models.cs

Comment thread src/MiniExcel/MiniExcelConverter.cs Outdated
Comment thread src/MiniExcel/MiniExcelConverter.cs
@michelebastione
michelebastione merged commit 3c6fd59 into mini-software:master Jul 20, 2026
4 checks passed
@michelebastione
michelebastione deleted the improved-docs branch July 20, 2026 23:10
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