#lint #error #pretty #spans #rustc #linting #messages

pretty-lint

A very simple library for showing lint errors

2 releases

0.1.1 Nov 6, 2020
0.1.0 Oct 5, 2020

#2541 in Development tools

Download history 26200/week @ 2024-11-17 13203/week @ 2024-11-24 22234/week @ 2024-12-01 20840/week @ 2024-12-08 21443/week @ 2024-12-15 3189/week @ 2024-12-22 6401/week @ 2024-12-29 21422/week @ 2025-01-05 30005/week @ 2025-01-12 22408/week @ 2025-01-19 27768/week @ 2025-01-26 31845/week @ 2025-02-02 32443/week @ 2025-02-09 24025/week @ 2025-02-16 28908/week @ 2025-02-23 24963/week @ 2025-03-02

111,463 downloads per month
Used in password-rules-parser

MIT license

16KB
410 lines

A way to print simple lint messages.

The output is similar to rustc's.


lib.rs:

A library for pretty-printing lint errors with a given source text.

The API is fairly minimal, and the output closely resembles rustc's.

Example usage:

let src = "highlight me";

let lint = PrettyLint::success(src)
            .at(Span::range((1, 1), (1, src.len())))
            .with_message("you have been highlighted")
            .with_inline_message("look at this")
            .with_file_path(file!());

println!("{}", lint);

Dependencies

~0.1–6.5MB
~33K SLoC