blob: 4836e247c161c84d0fc287f9f72b366712e5a93e (
plain) (
blame)
1
2
3
4
5
6
7
8
9
10
11
12
13
14
15
16
17
18
19
20
21
22
23
24
25
26
27
28
29
30
31
32
33
34
35
36
37
38
39
40
41
42
43
44
45
46
47
48
49
50
51
52
53
54
55
56
|
//! Template Linter
//!
//! ## Summary
//!
//! This is a template Linter that introduces how to add a Lint for Mingling.
//! You can write an introduction for this Linter in the Summary section, for example:
//!
//! - Trigger conditions
//! - Why is it necessary?
//!
//! ## Metadata
//!
//! > This section is the **Metadata** section, which needs to be filled in correctly.
//! > These contents will eventually be compiled as the Linter's behavior.
//!
//! Author: `Your-Name`
//! Default: `allow`
// ^^^^^ Supported parameters: `warn`, `allow`, `deny`
// --- ABOUT AUTO IDENTIFICATION RULES ---
//
// The compiler will treat code with the following structure as a Linter entry point:
// |
// --> your_linter_module.rs
// |
// | pub fn linter(ast: syn::ItemX) -> Vec<MlintReport> {
// | /* ... */ ^^^^^^^^^^ Your linter scope
// | }
// |
// = note: Please ensure your function is `pub`, named `linter`, and returns `Vec<MlintReport>`
//
// --- ABOUT AUTO IDENTIFICATION RULES ---
use crate::linter::mlint_report::MlintReport;
pub fn linter(_ast: syn::ItemFn, _source: &str) -> Vec<MlintReport> {
// ^^^^^^^^^^^ Supported parameters:
// | syn::File
// | syn::ItemImpl
// | syn::ItemStruct
// | syn::ItemEnum
// | syn::ItemTrait
// | syn::ItemFn
// | syn::ItemMacro
// | syn::ItemMod
// | syn::ItemUnion
vec![]
}
#[cfg(test)]
mod lint_test {
use crate::{assert_detected, assert_not_detected};
#[test]
fn test() {}
}
|