Skip to main content

Module lints

Module lints 

Source
Expand description

A harness for running custom text-based lints over repository files.

ModulesΒ§

cfg_target_arch πŸ”’
Checks that code uses guest_arch instead of target_arch for guest-architecture-specific conditionals.
copyright πŸ”’
Checks that source files have the correct copyright and license header.
crate_name_nodash πŸ”’
Checks that crate names and their containing folder names do not use dashes (hyphens). Use underscores instead.
package_info πŸ”’
Checks to ensure that the [package] sections of Cargo.toml files do not contain authors or version fields, and that rust-version, edition, and fields are properly workspaced.
repr_packed πŸ”’
Checks that #[repr(packed)] is not used without C β€” it should be #[repr(C, packed)].
trailing_newline πŸ”’
Checks that text files end with exactly one trailing newline.
unsafe_code_comment πŸ”’
Checks that uses of expect(unsafe_code) or allow(unsafe_code) are preceded by an // UNSAFETY: comment explaining the justification.
unused_deps πŸ”’
Check for unused Rust dependencies
workspaced πŸ”’
Checks that every crate’s Cargo.toml is properly workspaced.

StructsΒ§

LintCtx
Context passed to each lint, containing configuration options.
Lintable
A wrapper around file content for linting.
Lints

TraitsΒ§

Lint
A trait representing a single lint check.

FunctionsΒ§

lint_workspace πŸ”’
Run a fresh set of lints over a single workspace and its member crates..