#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

#1863 in Development tools

Download history 2155/week @ 2023-12-23 11401/week @ 2023-12-30 13031/week @ 2024-01-06 15261/week @ 2024-01-13 16120/week @ 2024-01-20 20313/week @ 2024-01-27 11862/week @ 2024-02-03 21615/week @ 2024-02-10 18864/week @ 2024-02-17 26930/week @ 2024-02-24 23804/week @ 2024-03-02 19324/week @ 2024-03-09 24414/week @ 2024-03-16 23714/week @ 2024-03-23 28351/week @ 2024-03-30 6804/week @ 2024-04-06

83,673 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–9MB
~52K SLoC