aboutsummaryrefslogtreecommitdiff
path: root/lib/src/lib.rs
diff options
context:
space:
mode:
authorAkshay <[email protected]>2021-12-29 05:23:38 +0000
committerAkshay <[email protected]>2022-01-08 10:33:10 +0000
commitd1ff222bcf94152cd657233cffd8c14a45788c26 (patch)
treefb8c94daefe0384a48b503fdd4bfaff905d78e2f /lib/src/lib.rs
parent94a2edf57340ac3f3a2276c88a221ba3125172af (diff)
allow for version based lints
Diffstat (limited to 'lib/src/lib.rs')
-rw-r--r--lib/src/lib.rs4
1 files changed, 3 insertions, 1 deletions
diff --git a/lib/src/lib.rs b/lib/src/lib.rs
index a25b814..cc4818a 100644
--- a/lib/src/lib.rs
+++ b/lib/src/lib.rs
@@ -1,9 +1,11 @@
1#![recursion_limit = "1024"] 1#![recursion_limit = "1024"]
2mod lints; 2mod lints;
3mod make; 3mod make;
4pub mod session;
4mod utils; 5mod utils;
5 6
6pub use lints::LINTS; 7pub use lints::LINTS;
8use session::SessionInfo;
7 9
8use rnix::{parser::ParseError, SyntaxElement, SyntaxKind, TextRange}; 10use rnix::{parser::ParseError, SyntaxElement, SyntaxKind, TextRange};
9use std::{convert::Into, default::Default}; 11use std::{convert::Into, default::Default};
@@ -221,7 +223,7 @@ impl Serialize for Suggestion {
221/// Lint logic is defined via this trait. Do not implement manually, 223/// Lint logic is defined via this trait. Do not implement manually,
222/// look at the `lint` attribute macro instead for implementing rules 224/// look at the `lint` attribute macro instead for implementing rules
223pub trait Rule { 225pub trait Rule {
224 fn validate(&self, node: &SyntaxElement) -> Option<Report>; 226 fn validate(&self, node: &SyntaxElement, sess: &SessionInfo) -> Option<Report>;
225} 227}
226 228
227/// Contains information about the lint itself. Do not implement manually, 229/// Contains information about the lint itself. Do not implement manually,