Skip to content

fix: render special permission bits#132

Merged
seapagan merged 10 commits into
mainfrom
fix/special-permission-bits
Jun 25, 2026
Merged

fix: render special permission bits#132
seapagan merged 10 commits into
mainfrom
fix/special-permission-bits

Conversation

@seapagan

@seapagan seapagan commented Jun 24, 2026

Copy link
Copy Markdown
Owner

Updates long-format Unix metadata rendering so special permission bits and special file types are displayed consistently.

Long-format permissions now render setuid, setgid, and sticky modes with s/S/t/T. Unix special file types now use standard type characters for sockets, FIFOs, character devices, and block devices, with matching name colors and Nerd Font icons where icons are enabled.

The shared file-type classifier now drives long-format type chars, name styling, icon selection, and indicator suffixes. Existing GNU-style suffix behavior is preserved for directories, symlinks, FIFOs, and sockets; executable * indicators apply only to regular executable files.

Summary by CodeRabbit

  • New Features

    • Added support for more filesystem entry types in listings, including sockets, FIFOs, character devices, and block devices.
    • Improved long-format and short-format visual indicators so these special items now show distinct colours and icons.
  • Bug Fixes

    • Corrected file-type detection for special Unix entries, including pipe/FIFO handling.
    • Expanded permission display to better reflect special access bits such as setuid, setgid, and sticky flags.

seapagan added 3 commits June 24, 2026 19:08
Signed-off-by: Grant Ramsay <seapagan@gmail.com>
Signed-off-by: Grant Ramsay <seapagan@gmail.com>
Signed-off-by: Grant Ramsay <seapagan@gmail.com>
@coderabbitai

coderabbitai Bot commented Jun 24, 2026

Copy link
Copy Markdown

Review Change Stack

Warning

Review limit reached

@seapagan, we couldn't start this review because you've reached your PR review rate limit.

More reviews will be available in 38 minutes and 26 seconds. Learn how PR review limits work.

Your organization has used up its prepaid credits, and credit purchases are no longer available. Enable the review add-on in the billing tab to keep reviews running — you're only billed for reviews past your plan's rate limits ($0.25/file).

⌛ How to resolve this issue?

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 credits.

🚦 How do rate 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 see our Fair Usage Limits Policy for further information.

ℹ️ Review info
⚙️ Run configuration

Configuration used: Organization UI

Review profile: CHILL

Plan: Pro

Run ID: fe19d38f-e495-4891-a587-3bb5f3d22d1d

📥 Commits

Reviewing files that changed from the base of the PR and between b421997 and 3e38d16.

📒 Files selected for processing (1)
  • TODO.md
📝 Walkthrough

Walkthrough

The PR adds a long-format file-type classifier for sockets, FIFOs, character devices, and block devices, threads that classification through file details, icons, name styling, and type indicators, and updates permission formatting for setuid, setgid, and sticky bits. Tests cover the new mappings and rendered output.

Changes

Filesystem type and display formatting

Layer / File(s) Summary
Public file-type contracts
src/structs.rs, src/utils/file.rs, tests/crate/file.rs
NameStyle gains socket, FIFO, character-device, and block-device variants; FileInfo.file_type documents the long-format file-type characters; long_format_file_type classifies metadata for get_file_details, with FIFO classification tests updated.
Special file-type rendering
src/utils/file.rs, src/utils/icons.rs, src/utils/render.rs, tests/crate/file.rs, tests/crate/icons.rs
LongFormatFileType now drives suffix selection, name-style selection, icon choice, and coloured type markers for socket, FIFO, character-device, and block-device entries, with tests covering the new mappings.
Permission formatting and table rendering
src/utils/format.rs, src/utils/render.rs, tests/crate/render.rs, tests/format.rs
mode_to_rwx now uses direct bit checks and helper functions for special execute bits, and long-format rendering/tests cover the updated permission characters and special file-type markers in table output.

Sequence Diagram(s)

sequenceDiagram
  participant ComponentA
  participant ComponentB
  ComponentA->>ComponentB: observable interaction
Loading

Estimated code review effort

🎯 4 (Complex) | ⏱️ ~45 minutes

Possibly related PRs

  • seapagan/lsplus#114: This PR extends the same NameStyle/rendering pipeline by adding special file-type variants and updated colour handling.
  • seapagan/lsplus#117: This PR changes file entry classification and indicator rendering in src/utils/file.rs, which is the same area extended here with LongFormatFileType and suffix mapping.

Suggested labels

testing

Poem

I hop where pipes and sockets gleam,
And blocky badges glow in stream.
With rwsr-tS-T I laugh and squeak,
Then paint each name in colour neat. 🐇

🚥 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 accurately reflects the main permissions-rendering change, though it does not mention the related special file type updates.
Docstring Coverage ✅ Passed Docstring coverage is 84.85% 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 unit tests (beta)
  • Create PR with unit tests
  • Commit unit tests in branch fix/special-permission-bits

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.

@codacy-production

codacy-production Bot commented Jun 24, 2026

Copy link
Copy Markdown

Up to standards ✅

🟢 Issues 0 issues

Results:
0 new issues

View in Codacy

🟢 Metrics -10 complexity · 2 duplication

Metric Results
Complexity -10
Duplication 2

View in Codacy

NEW Get contextual insights on your PRs based on Codacy's metrics, along with PR and Jira context, without leaving GitHub. Enable AI reviewer
TIP This summary will be updated as you push new changes.

@seapagan seapagan self-assigned this Jun 24, 2026
@seapagan seapagan added the enhancement New feature or request label Jun 24, 2026
seapagan added 6 commits June 24, 2026 21:28
Signed-off-by: Grant Ramsay <seapagan@gmail.com>
Signed-off-by: Grant Ramsay <seapagan@gmail.com>
Signed-off-by: Grant Ramsay <seapagan@gmail.com>
Signed-off-by: Grant Ramsay <seapagan@gmail.com>
Signed-off-by: Grant Ramsay <seapagan@gmail.com>
Signed-off-by: Grant Ramsay <seapagan@gmail.com>
@seapagan seapagan marked this pull request as ready for review June 25, 2026 18:41

@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: 1

🤖 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/structs.rs`:
- Around line 111-118: The public enum NameStyle now has additional variants,
which is a breaking API change for downstream users of the re-export in lib.rs.
Update Cargo.toml to reflect the required major version bump before publishing,
and make sure the version change is aligned with the NameStyle enum expansion so
consumers can rely on semver expectations.
🪄 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: Organization UI

Review profile: CHILL

Plan: Pro

Run ID: 3325b579-5834-4ece-9aa7-91db367ed719

📥 Commits

Reviewing files that changed from the base of the PR and between 91bbb85 and b421997.

📒 Files selected for processing (9)
  • src/structs.rs
  • src/utils/file.rs
  • src/utils/format.rs
  • src/utils/icons.rs
  • src/utils/render.rs
  • tests/crate/file.rs
  • tests/crate/icons.rs
  • tests/crate/render.rs
  • tests/format.rs

Comment thread src/structs.rs
Signed-off-by: Grant Ramsay <seapagan@gmail.com>
@seapagan seapagan merged commit e7015e4 into main Jun 25, 2026
3 of 5 checks passed
@seapagan seapagan deleted the fix/special-permission-bits branch June 25, 2026 19:02
Sign up for free to join this conversation on GitHub. Already have an account? Sign in to comment

Labels

enhancement New feature or request

Projects

None yet

Development

Successfully merging this pull request may close these issues.

1 participant