Linting for the Microdragon kernel.
Microlint provides rustc lints for use in the Microdragon kernel project. The
lints are implemented using dylint
and the rustc linting infrastructure.
Currently the following lints are provided:
A lint that checks if a functions marked as #[init] is called from a
non-#[init] function. This is required, since #[init] functions might be
unmapped, once the kernel init phase completes, dues calling them would cause a
page fault in the kernel. This lint prevents accidentally calling an #[init]
function.
A lint that checks if a static marked as #[init] is accessed by a
non-#[init] function. This is required, since #[init] statics might be
unmapped, once the kernel init phase completes, dues accessing them would cause
a page fault in the kernel. This lint prevents accidentally accessing an
#[init] static.
Contributing is pretty straight forward. The only things required are
cargo-dylint and dylint-link, wich can be installed using cargo
cargo install cargo-dylint dylint-linkEach lint is implemented as it's own crate under the lint folder, which are
then tied together in the main microlint crate. The main microlint crate
just depends on each lint crate and registers them in src/lib.rs. Each lint
crates provides a readme, describing the lint in the clippy format as well as
snapshot tests in the ui folder of each lint.
If you got an idea for a new lint or found a bug in an existing one, don't hesitate to create an issue for it. You are also free to implement the lint or provide a bugfix yourself! We always welcome contributions!
This Project, like most Microdragon projects, is licensed under the Mozilla Public License Version 2.0 (LICENSE)
The SPDX license identifier for this project is MPL-2.0.