#lint #error #pretty #spans #rustc #linting #source

pretty-lint

A very simple library for showing lint errors

2 releases

0.1.1 Nov 6, 2020
0.1.0 Oct 5, 2020

#2168 in Development tools

Download history 30003/week @ 2024-07-23 20700/week @ 2024-07-30 21031/week @ 2024-08-06 14242/week @ 2024-08-13 18338/week @ 2024-08-20 16247/week @ 2024-08-27 20082/week @ 2024-09-03 15965/week @ 2024-09-10 18541/week @ 2024-09-17 19082/week @ 2024-09-24 19895/week @ 2024-10-01 19118/week @ 2024-10-08 23278/week @ 2024-10-15 25731/week @ 2024-10-22 20128/week @ 2024-10-29 27090/week @ 2024-11-05

97,601 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–9.5MB
~42K SLoC