#lint #error #spans #pretty #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

#1869 in Development tools

Download history 17228/week @ 2023-11-20 13320/week @ 2023-11-27 14938/week @ 2023-12-04 13360/week @ 2023-12-11 7880/week @ 2023-12-18 2079/week @ 2023-12-25 11666/week @ 2024-01-01 13415/week @ 2024-01-08 15212/week @ 2024-01-15 15725/week @ 2024-01-22 20623/week @ 2024-01-29 11493/week @ 2024-02-05 22259/week @ 2024-02-12 19014/week @ 2024-02-19 26520/week @ 2024-02-26 24575/week @ 2024-03-04

92,449 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
~55K SLoC