diff options
author | Akshay <[email protected]> | 2021-12-29 05:23:38 +0000 |
---|---|---|
committer | Akshay <[email protected]> | 2022-01-08 10:33:10 +0000 |
commit | d1ff222bcf94152cd657233cffd8c14a45788c26 (patch) | |
tree | fb8c94daefe0384a48b503fdd4bfaff905d78e2f /lib/src/lib.rs | |
parent | 94a2edf57340ac3f3a2276c88a221ba3125172af (diff) |
allow for version based lints
Diffstat (limited to 'lib/src/lib.rs')
-rw-r--r-- | lib/src/lib.rs | 4 |
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"] |
2 | mod lints; | 2 | mod lints; |
3 | mod make; | 3 | mod make; |
4 | pub mod session; | ||
4 | mod utils; | 5 | mod utils; |
5 | 6 | ||
6 | pub use lints::LINTS; | 7 | pub use lints::LINTS; |
8 | use session::SessionInfo; | ||
7 | 9 | ||
8 | use rnix::{parser::ParseError, SyntaxElement, SyntaxKind, TextRange}; | 10 | use rnix::{parser::ParseError, SyntaxElement, SyntaxKind, TextRange}; |
9 | use std::{convert::Into, default::Default}; | 11 | use 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 |
223 | pub trait Rule { | 225 | pub 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, |