Write Rust lints without forking Clippy | Trail of Bits Blog
This blog post introduces Dylint, a tool for loading Rust linting rules (or “lints”) from dynamic libraries. Dylint makes it easy for developers to maintain their own personal lint collections. Previously, the simplest way to write a new Rust lint was to fork Clippy, Rust’s de facto linting tool. But this approach has drawbacks in how one runs and maintains new lints. Dylint minimizes these distractions so that developers can focus on actually writing lints. First, we’ll go over the current state of Rust linting and the workings of Clippy. Then, we’ll explain how Dylint improves upon the status quo and offer some tips on how to begin using it. Skip to the last section, If you want to get straight to writing lints. Tools like Clippy take advantage of the Rust compiler’s dedicated support for linting. A Rust linter’s core component, called a “driver,” links against an appropriately named library, rustc_driver. By doing so, the driver essentially becomes a wrapper around the Rust compiler
Page content Originally published May 20, 2021 This blog post introduces Dylint , a tool for loading Rust linting rules (or “lints”) from dynamic libraries. Dylint makes it easy for developers to maintain their own personal lint collections. Previously, the simplest way to write a new Rust lint was to fork Clippy , Rust’s de facto linting tool. But this approach has drawbacks in how one runs and maintains new lints. Dylint minimizes these distractions so that developers can focus on actually writing lints. First, we’ll go over the current state of Rust linting and the workings of Clippy. Then,
related reading
- Rewriting Bun in Rust | Bun Blogbun.com
- A half-hour to learn Rustfasterthanli.me
- What Is Linting + When to Use Lint Tools | Perforce Softwareperforce.com
- rust-lang/rust is adopting an LLM policy | Inside Rust Blogblog.rust-lang.org
- The LLVM Compiler Infrastructure Projectllvm.org
- Patterns for Defensive Programming in Rust | corrode Rust Consultingcorrode.dev
- Rust Language Cheat Sheetcheats.rs
- What is Ownership? - The Rust Programming Languagedoc.rust-lang.org
- First thoughts on Rust vs OCamlblog.darklang.com
- Ralph Wiggum as a "software engineer"ghuntley.com
- Learn Rust the Dangerous Waycliffle.com
- Could we have Rust without provenance? · Issue #287 · rust-lang/unsafe-code-guidelines · GitHubgithub.com