Skip to content

Hide sheets whose name starts with a dot#286

Merged
soimkim merged 2 commits into
mainfrom
dot
Jul 1, 2026
Merged

Hide sheets whose name starts with a dot#286
soimkim merged 2 commits into
mainfrom
dot

Conversation

@soimkim

@soimkim soimkim commented Jul 1, 2026

Copy link
Copy Markdown
Contributor

Summary by CodeRabbit

  • Bug Fixes

    • Worksheets with names starting with a dot are now hidden in exported Excel files.
    • Visible sheet names continue to appear normally.
  • Tests

    • Added coverage to verify worksheet visibility in generated .xlsx files for both hidden and visible sheet names.

@soimkim soimkim self-assigned this Jul 1, 2026
@soimkim soimkim added the chore [PR/Issue] Refactoring, maintenance the code label Jul 1, 2026
@coderabbitai

coderabbitai Bot commented Jul 1, 2026

Copy link
Copy Markdown
Contributor

Review Change Stack

Warning

Review limit reached

@soimkim, you've reached your PR review limit, so we couldn't start this review.

Next review available in: 53 minutes

Enable usage-based reviews in Billing to review now. Otherwise, wait until the next included review is available.
You're only billed for reviews past your plan's rate limits ($0.25/file).

How can I continue?

After more reviews become available, a review can be triggered using the @coderabbitai review command as a PR comment. Alternatively, push new commits to this PR.

To avoid repeated limits, reduce automatic review volume by pausing incremental auto-reviews earlier, using label-based review opt-in, excluding WIP or generated PR titles, or requesting reviews manually when the PR is ready. If your team needs uninterrupted high-volume reviews, an organization admin can enable usage-based reviews.

How do review limits work?

CodeRabbit enforces per-developer PR review limits for each organization. Most developers receive the normal plan review availability.

For paid Pro and Pro+ PR reviews, CodeRabbit uses adaptive limits for sustained high-volume activity. When a developer's recent PR review activity reaches the 95th percentile or higher among CodeRabbit users, additional reviews become available more gradually as earlier reviews age out of the rolling window.

Please refer docs for additional details.

Review details
⚙️ Run configuration

Configuration used: Path: .coderabbit.yaml

Review profile: CHILL

Plan: Pro

Run ID: d098ae16-f99e-4923-a6f4-b7f060f97616

📥 Commits

Reviewing files that changed from the base of the PR and between aae7d51 and 6c07a59.

📒 Files selected for processing (3)
  • .github/workflows/pull-request.yml
  • requirements-dev.txt
  • tox.ini
📝 Walkthrough

Walkthrough

Added a private helper _should_hide_sheet in write_excel.py that checks whether a sheet name starts with a dot, and wired it into create_worksheet to hide matching worksheets. A new parametrized pytest test verifies the resulting sheet_state for hidden and visible sheets.

Changes

Hidden Sheet Feature

Layer / File(s) Summary
Hide sheet detection and worksheet wiring
src/fosslight_util/write_excel.py
Adds _should_hide_sheet to detect dot-prefixed sheet names and calls worksheet.hide() in create_worksheet when true.
Hidden sheet test coverage
tests/test_write_excel_hidden_sheet.py
Adds a parametrized test writing an Excel file and asserting openpyxl sheet_state for hidden vs. visible sheet names.

Estimated code review effort: 1 (Trivial) | ~5 minutes

Sequence Diagram(s)

sequenceDiagram
  participant Test as test_write_excel_hidden_sheet
  participant Writer as write_output_file
  participant Worksheet as create_worksheet

  Test->>Writer: write_output_file(scan_item)
  Writer->>Worksheet: create_worksheet(sheet_name)
  Worksheet->>Worksheet: _should_hide_sheet(sheet_name)
  alt name starts with "."
    Worksheet->>Worksheet: worksheet.hide()
  end
  Test->>Test: reload workbook and assert sheet_state
Loading

Related PRs: None identified

Suggested labels: enhancement, tests

Suggested reviewers: None identified

🐰 A dot before a name, so clever and slight,
Hides the sheet away, out of plain sight,
A test peeks inside with openpyxl's eye,
Confirming the hidden ones quietly lie.

🚥 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 clearly matches the main change: hiding Excel sheets whose names start with a dot.
Docstring Coverage ✅ Passed No functions found in the changed files to evaluate docstring coverage. Skipping docstring coverage check.
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
  • Commit unit tests in branch dot

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.

@soimkim
soimkim requested a review from JustinWonjaePark July 1, 2026 22:57

@coderabbitai coderabbitai Bot left a comment

Copy link
Copy Markdown
Contributor

Choose a reason for hiding this comment

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

Caution

Some comments are outside the diff and can’t be posted inline due to platform limitations.

⚠️ Outside diff range comments (1)
src/fosslight_util/write_excel.py (1)

232-245: 🎯 Functional Correctness | 🟡 Minor | ⚡ Quick win

Hide check runs after sheet-name truncation, so long dot-prefixed names silently stay visible.

_should_hide_sheet(sheet_name) at Line 244 is evaluated against sheet_name after it may have been replaced by current_time (Lines 237-239) when the original name exceeds 31 characters. In that case the original dot-prefix intent is lost entirely and the sheet is created visible, silently defeating the new feature for this class of input.

🔧 Suggested fix: evaluate hide intent before truncation
 def create_worksheet(workbook, sheet_name, header_row):
+    should_hide = _should_hide_sheet(sheet_name)
     if len(sheet_name) > 31:
         current_time = str(time.time())
         sheet_name = current_time
     worksheet = workbook.add_worksheet(sheet_name)
     if header_row:
         for col_num, value in enumerate(header_row):
             worksheet.write(0, col_num, value)
-    if _should_hide_sheet(sheet_name):
+    if should_hide:
         worksheet.hide()
     return worksheet
🤖 Prompt for 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.

In `@src/fosslight_util/write_excel.py` around lines 232 - 245, Hide-sheet intent
is being lost in create_worksheet because _should_hide_sheet() is checked after
sheet_name may be replaced when it exceeds the workbook limit. Update
create_worksheet so the original sheet_name is inspected for the dot-prefix
before any renaming/truncation, preserve that hide flag separately, and then
apply worksheet.hide() based on the preserved value even if the final worksheet
name changes.
🤖 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.

Outside diff comments:
In `@src/fosslight_util/write_excel.py`:
- Around line 232-245: Hide-sheet intent is being lost in create_worksheet
because _should_hide_sheet() is checked after sheet_name may be replaced when it
exceeds the workbook limit. Update create_worksheet so the original sheet_name
is inspected for the dot-prefix before any renaming/truncation, preserve that
hide flag separately, and then apply worksheet.hide() based on the preserved
value even if the final worksheet name changes.

ℹ️ Review info
⚙️ Run configuration

Configuration used: Path: .coderabbit.yaml

Review profile: CHILL

Plan: Pro

Run ID: 7f35e6a0-789b-40b6-b98a-c8c7f1eb6b5d

📥 Commits

Reviewing files that changed from the base of the PR and between cf51ea9 and aae7d51.

📒 Files selected for processing (2)
  • src/fosslight_util/write_excel.py
  • tests/test_write_excel_hidden_sheet.py

@soimkim
soimkim merged commit 059630b into main Jul 1, 2026
8 checks passed
Sign up for free to join this conversation on GitHub. Already have an account? Sign in to comment

Labels

chore [PR/Issue] Refactoring, maintenance the code

Projects

None yet

Development

Successfully merging this pull request may close these issues.

2 participants