Skip to content

clippy: enable doc_markdown lint - #15283

Open
vatsanbalaji-ossagent wants to merge 4 commits into
uutils:mainfrom
vatsanbalaji-ossagent:clippy-doc-markdown
Open

vatsanbalaji-ossagent wants to merge 4 commits into
uutils:mainfrom
vatsanbalaji-ossagent:clippy-doc-markdown

Conversation

@vatsanbalaji-ossagent

Copy link
Copy Markdown
Contributor

Following up on sylvestre’s feedback in #15257, this PR removes the doc_markdown lint suppression and fixes the remaining warnings throughout the workspace. It also adds AppArmor and SELinux to the accepted words list to prevent unnecessary warnings.

Ref #4949

🤖 Generated with Claude Code

@codspeed

codspeed Bot commented Oct 12, 2026 •

Copy link
Copy Markdown

Merging this PR will degrade performance by 15.66%

⚠️ 119 benchmarks spent significant time in system calls

System calls cannot be consistently instrumented, so they are not included in the measure, which understates the real cost. Please switch to the Walltime instrument to accurately measure system calls.

Measurement and system calls

ℹ️ 1 benchmark has no flame graph

The flamegraph could not be generated because too much time was spent in runtime internals, making the visualization not useful for performance analysis.

⚠️ Different runtime environments detected

Some benchmarks with significant performance changes were compared across different runtime environments,
which may affect the accuracy of the results.

Open the report in CodSpeed to investigate

⚡ 1 improved benchmark
❌ 1 regressed benchmark
✅ 399 untouched benchmarks
⏩ 70 skipped benchmarks1

Warning

Please fix the performance issues or acknowledge them on CodSpeed.

Performance Changes

Mode Benchmark BASE HEAD Efficiency
❌ Simulation factor_three_39_bit_primes 598.6 ms 950.4 ms -37.02%
⚡ Simulation factor_five_38_bit_primes 1.9 s 1.7 s +12.94%

Tip

Investigate this regression by commenting @codspeedbot fix this regression on this PR, or directly use the CodSpeed MCP with your agent.


Comparing vatsanbalaji-ossagent:clippy-doc-markdown (947e1d7) with main (b136eca)2

Open in CodSpeed

Footnotes

  1. 70 benchmarks were skipped, so the baseline results were used instead. If they were deleted from the codebase, click here and archive them to remove them from the performance reports. ↩

  2. No successful run was found on main (4945ecf) during the generation of this report, so b136eca was used instead as the comparison base. There might be some changes unrelated to this pull request in this report. ↩

@RenjiSann RenjiSann left a comment

Copy link
Copy Markdown
Collaborator

Choose a reason for hiding this comment

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

I've only browsed half the diff, but you get the idea. Adding brackets around rust identifiers allows for rustdoc to generate links

Comment thread src/bin/uudoc.rs Outdated
}

/// Format examples using std::fmt::Write
/// Format examples using `std::fmt::Write`

Copy link
Copy Markdown
Collaborator

Choose a reason for hiding this comment

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

Suggested change
/// Format examples using `std::fmt::Write`
/// Format examples using [`std::fmt::Write`]

You can even put brackets around it so the doc generation makes it a working link to the documentation of std::fmt::Write.

Comment thread src/uu/date/src/date.rs Outdated

/// Build timezone abbreviation lookup map from IANA database.
/// This is a fallback for abbreviations not covered by FIXED_OFFSET_ABBREVIATIONS.
/// This is a fallback for abbreviations not covered by `FIXED_OFFSET_ABBREVIATIONS`.

Copy link
Copy Markdown
Collaborator

Choose a reason for hiding this comment

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

Suggested change
/// This is a fallback for abbreviations not covered by `FIXED_OFFSET_ABBREVIATIONS`.
/// This is a fallback for abbreviations not covered by [`FIXED_OFFSET_ABBREVIATIONS`].

Comment thread src/uu/date/src/locale.rs Outdated
Comment on lines +78 to +80
/// Mutex to serialize `setlocale()` calls during tests.
///
/// setlocale() is process-global, so parallel tests that call it can
/// `setlocale()` is process-global, so parallel tests that call it can

Copy link
Copy Markdown
Collaborator

Choose a reason for hiding this comment

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

Suggested change
/// Mutex to serialize `setlocale()` calls during tests.
///
/// setlocale() is process-global, so parallel tests that call it can
/// `setlocale()` is process-global, so parallel tests that call it can
/// Mutex to serialize [`libc::setlocale`] calls during tests.
///
/// [`libc::setlocale`] is process-global, so parallel tests that call it can

Comment thread src/uu/dd/src/conversion_tables.rs Outdated
pub type ConversionTable = [u8; 256];

/// Builds a lowercase conversion table using locale-aware libc::tolower
/// Builds a lowercase conversion table using locale-aware `libc::tolower`

Copy link
Copy Markdown
Collaborator

Choose a reason for hiding this comment

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

Suggested change
/// Builds a lowercase conversion table using locale-aware `libc::tolower`
/// Builds a lowercase conversion table using locale-aware [`libc::tolower`]

Comment thread src/uu/dd/src/conversion_tables.rs Outdated
}

/// Builds an uppercase conversion table using locale-aware libc::toupper
/// Builds an uppercase conversion table using locale-aware `libc::toupper`

Copy link
Copy Markdown
Collaborator

Choose a reason for hiding this comment

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

Suggested change
/// Builds an uppercase conversion table using locale-aware `libc::toupper`
/// Builds an uppercase conversion table using locale-aware [`libc::toupper`]

Comment thread src/uu/ls/src/ls.rs Outdated

impl<'a> PathData<'a> {
/// Convert this PathData to an EntryInfo for programmatic access
/// Convert this `PathData` to an `EntryInfo` for programmatic access

Copy link
Copy Markdown
Collaborator

Choose a reason for hiding this comment

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

Suggested change
/// Convert this `PathData` to an `EntryInfo` for programmatic access
/// Convert this [`PathData`] to an [`EntryInfo`] for programmatic access

Comment thread src/uu/od/src/od.rs Outdated
}

/// Helper function to convert input strings to InputSource
/// Helper function to convert input strings to `InputSource`

Copy link
Copy Markdown
Collaborator

Choose a reason for hiding this comment

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

Suggested change
/// Helper function to convert input strings to `InputSource`
/// Helper function to convert input strings to [`InputSource`]

Comment thread src/uu/seq/src/numberparse.rs Outdated

/// Compute the number of integral and fractional digits in input string,
/// and wrap the result in a PreciseNumber.
/// and wrap the result in a `PreciseNumber`.

Copy link
Copy Markdown
Collaborator

Choose a reason for hiding this comment

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

Suggested change
/// and wrap the result in a `PreciseNumber`.
/// and wrap the result in a [`PreciseNumber`].

vatsanbalaji-ossagent and others added 4 commits October 15, 2026 12:52
Stop allowing clippy::doc_markdown and fix the remaining warnings
across the workspace by wrapping identifiers and bare URLs in doc
comments. Add AppArmor and SELinux to doc-valid-idents so product
names are not flagged. Docs and lint config only.

Co-Authored-By: Claude Opus 5.5 <noreply@anthropic.com>
Fix the doc_markdown warnings in Linux-only tests for cat, mv and
stdbuf, which were not compiled on macOS.

Co-Authored-By: Claude Opus 5.5 <noreply@anthropic.com>
Co-Authored-By: Claude Opus 5.5 <noreply@anthropic.com>
Turn backticked identifiers into intra-doc links where rustdoc can
resolve them, as suggested in review. Names that are not Rust items in
scope (environment variables, C constants, parameters) and references in
tests, benches and platform-specific code stay as plain code spans.

Co-Authored-By: Claude Opus 5.5 <noreply@anthropic.com>
@vatsanbalaji-ossagent

Copy link
Copy Markdown
Contributor Author

Thanks for the review, RenjiSann!

I went through the entire PR and applied the bracket links wherever appropriate, including places beyond the examples you pointed out.

I kept environment variables, C constants, and parameter names in plain backticks since they aren't Rust items in scope and would result in broken links. I also left references in tests, benchmarks, and platform-specific code in backticks because cargo doc can't validate those links.

I also rebased onto main and addressed a new warning introduced by upstream changes.

This branch has not been deployed

No deployments
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.

2 participants