Skip to content
New issue

Have a question about this project? Sign up for a free GitHub account to open an issue and contact its maintainers and the community.

By clicking “Sign up for GitHub”, you agree to our terms of service and privacy statement. We’ll occasionally send you account related emails.

Already on GitHub? Sign in to your account

docs: plural section headers #1114

Closed
Closed
Show file tree
Hide file tree
Changes from all commits
Commits
File filter

Filter by extension

Filter by extension

Conversations
Failed to load comments.
Loading
Jump to
Jump to file
Failed to load files.
Loading
Diff view
Diff view
2 changes: 1 addition & 1 deletion rust/kernel/init.rs
Original file line number Diff line number Diff line change
Expand Up @@ -746,7 +746,7 @@ macro_rules! try_init {
/// Asserts that a field on a struct using `#[pin_data]` is marked with `#[pin]` ie. that it is
/// structurally pinned.
///
/// # Example
/// # Examples
///
/// This will succeed:
/// ```
Expand Down
2 changes: 1 addition & 1 deletion rust/kernel/list/arc.rs
Original file line number Diff line number Diff line change
Expand Up @@ -464,7 +464,7 @@ where

/// A utility for tracking whether a [`ListArc`] exists using an atomic.
///
/// # Invariant
/// # Invariants
///
/// If the boolean is `false`, then there is no [`ListArc`] for this value.
#[repr(transparent)]
Expand Down
2 changes: 1 addition & 1 deletion rust/kernel/sync/arc.rs
Original file line number Diff line number Diff line change
Expand Up @@ -436,7 +436,7 @@ impl<T: ?Sized> From<Pin<UniqueArc<T>>> for Arc<T> {
/// There are no mutable references to the underlying [`Arc`], and it remains valid for the
/// lifetime of the [`ArcBorrow`] instance.
///
/// # Example
/// # Examples
///
/// ```
/// use kernel::sync::{Arc, ArcBorrow};
Expand Down
2 changes: 1 addition & 1 deletion rust/macros/lib.rs
Original file line number Diff line number Diff line change
Expand Up @@ -307,7 +307,7 @@ pub fn pinned_drop(args: TokenStream, input: TokenStream) -> TokenStream {
/// literals (lifetimes and documentation strings are not supported). There is a difference in
/// supported modifiers as well.
///
/// # Example
/// # Examples
///
/// ```ignore
/// use kernel::macro::paste;
Expand Down
7 changes: 7 additions & 0 deletions scripts/checkpatch.pl
Original file line number Diff line number Diff line change
Expand Up @@ -3900,6 +3900,13 @@ sub process {
"Avoid using '.L' prefixed local symbol names for denoting a range of code via 'SYM_*_START/END' annotations; see Documentation/core-api/asm-annotations.rst\n" . $herecurr);
}

# check that document section headers are plural in rust files
if ($realfile =~ /\.rs$/
&& $rawline =~ /^\+\s*\/\/\/\s+#+\s+(Example|Invariant|Guarantee|Panic)\s*$/) {
WARN( "RUST_DOC_HEADER",
"Rust doc headers should be plural\n" . $herecurr );
}

# check we are in a valid source file C or perl if not then ignore this hunk
next if ($realfile !~ /\.(h|c|pl|dtsi|dts)$/);

Expand Down