An experimental linting interface for Rust. Let's make custom lints a reality
See the code
Marker is an experimental code analysis interface, with the goal to create a stable and user-friendly linting framework for the Rust programming language. Creating custom lints should be a straightforward process, and using them should be as simple as declaring a new dependency.
Let's make custom lints and code analysis a reality!
Note
The project is in the early stages of development, some things are still missing and the API is still unstable.
A collection of features, goals and current limitations is available below.
And more to come, see Marker's goals and limitations below.
The following is an abbreviated guide. Check out The Marker Book for detailed instructions and additional information.
We provide pre-compiled binaries for the mainstream platforms. See the list of available artifacts in our Github Releases.
Select one of the installation scripts below according to your platform. The script will install the required Rust toolchain dependency on your machine, download the current version of cargo-marker CLI, and the internal driver.
Linux or MacOS (Bash):
curl -fsSL https://raw.githubusercontent.com/rust-marker/marker/v0.5/scripts/release/install.sh | bash
Windows (PowerShell):
curl.exe -fsSL https://raw.githubusercontent.com/rust-marker/marker/v0.5/scripts/release/install.ps1 | powershell -command -
The provided scripts use a sliding git tag v0.5, to allow for automatic patch version updates, however a fixed tag v0.5.0 is also available.
If you are on a platform that isn't supported yet by the pre-compiled binaries, then you should fall back to building from sources as described below.
cargo install cargo_marker
# Automatically setup the toolchain and build driver from sources
cargo marker setup --auto-install-toolchain
Marker provides a Github Action that downloads the pre-compiled binaries and runs cargo marker.
- uses: rust-marker/marker@v0.5
If you want to only install Marker, and not run it, there is an option for that.
- uses: rust-marker/marker@v0.5
with:
install-only: true
# `cargo marker` command should be available at this point
- run: cargo marker --version
See The Marker Book for more details and examples of workflows.
Marker requires lint crates to be specified. The best way is to add them to the Cargo.toml file, like this:
[workspace.metadata.marker.lints]
# A local crate as a path
marker_lints = { path = './marker_lints' }
# An external crate via git
marker_lints = { git = "https://github.com/rust-marker/marker" }
# An external crate from a registry
marker_lints = "0.5.0"
You can create your own lint crates if you want, the lint-crate-template has all the basics for you to get started writing your own lints.
Running Marker is as simple as running its sibling Clippy. Navigate to your Rust project directory and run the following command:
cargo marker
This will initialize Marker, compile the lint crates and start linting.
Marker is still growing up, and that's a good thing. We can still shape the API and adapt it to what the user needs. However, this and the fact that Marker is not an official Rust project comes with some limitations:
The used nightly version will be updated every 6 weeks, when a new version of Rust is released.
Contributions are highly appreciated! If you encounter any issues or have suggestions for improvements, please don't hesitate to open an issue. If you have an idea for a lint you want to implement with Marker, please share it by creating a user story.
Still reading? Interested in helping out? Wonderful! Check out Marker's contributor documentation
Copyright (c) 2022-2023 Rust-Marker
Rust-marker is distributed under the terms of the MIT license or the Apache License (Version 2.0).
See LICENSE-APACHE, LICENSE-MIT.
Marker is inspired and contains code snippets from rustc, Clippy and the Rust Reference. These projects are dual-licensed under the Apache 2.0 and MIT licenses. See ./COPYRIGHT.md
Rust
94.9%
Shell
3.6%
PowerShell
1.5%
An experimental linting interface for Rust. Let's make custom lints a reality
See the code
Marker is an experimental code analysis interface, with the goal to create a stable and user-friendly linting framework for the Rust programming language. Creating custom lints should be a straightforward process, and using them should be as simple as declaring a new dependency.
Let's make custom lints and code analysis a reality!
Note
The project is in the early stages of development, some things are still missing and the API is still unstable.
A collection of features, goals and current limitations is available below.
And more to come, see Marker's goals and limitations below.
The following is an abbreviated guide. Check out The Marker Book for detailed instructions and additional information.
We provide pre-compiled binaries for the mainstream platforms. See the list of available artifacts in our Github Releases.
Select one of the installation scripts below according to your platform. The script will install the required Rust toolchain dependency on your machine, download the current version of cargo-marker CLI, and the internal driver.
Linux or MacOS (Bash):
curl -fsSL https://raw.githubusercontent.com/rust-marker/marker/v0.5/scripts/release/install.sh | bash
Windows (PowerShell):
curl.exe -fsSL https://raw.githubusercontent.com/rust-marker/marker/v0.5/scripts/release/install.ps1 | powershell -command -
The provided scripts use a sliding git tag v0.5, to allow for automatic patch version updates, however a fixed tag v0.5.0 is also available.
If you are on a platform that isn't supported yet by the pre-compiled binaries, then you should fall back to building from sources as described below.
cargo install cargo_marker
# Automatically setup the toolchain and build driver from sources
cargo marker setup --auto-install-toolchain
Marker provides a Github Action that downloads the pre-compiled binaries and runs cargo marker.
- uses: rust-marker/marker@v0.5
If you want to only install Marker, and not run it, there is an option for that.
- uses: rust-marker/marker@v0.5
with:
install-only: true
# `cargo marker` command should be available at this point
- run: cargo marker --version
See The Marker Book for more details and examples of workflows.
Marker requires lint crates to be specified. The best way is to add them to the Cargo.toml file, like this:
[workspace.metadata.marker.lints]
# A local crate as a path
marker_lints = { path = './marker_lints' }
# An external crate via git
marker_lints = { git = "https://github.com/rust-marker/marker" }
# An external crate from a registry
marker_lints = "0.5.0"
You can create your own lint crates if you want, the lint-crate-template has all the basics for you to get started writing your own lints.
Running Marker is as simple as running its sibling Clippy. Navigate to your Rust project directory and run the following command:
cargo marker
This will initialize Marker, compile the lint crates and start linting.
Marker is still growing up, and that's a good thing. We can still shape the API and adapt it to what the user needs. However, this and the fact that Marker is not an official Rust project comes with some limitations:
The used nightly version will be updated every 6 weeks, when a new version of Rust is released.
Contributions are highly appreciated! If you encounter any issues or have suggestions for improvements, please don't hesitate to open an issue. If you have an idea for a lint you want to implement with Marker, please share it by creating a user story.
Still reading? Interested in helping out? Wonderful! Check out Marker's contributor documentation
Copyright (c) 2022-2023 Rust-Marker
Rust-marker is distributed under the terms of the MIT license or the Apache License (Version 2.0).
See LICENSE-APACHE, LICENSE-MIT.
Marker is inspired and contains code snippets from rustc, Clippy and the Rust Reference. These projects are dual-licensed under the Apache 2.0 and MIT licenses. See ./COPYRIGHT.md
Rust
94.9%
Shell
3.6%
PowerShell
1.5%