aboutsummaryrefslogtreecommitdiff
diff options
context:
space:
mode:
-rw-r--r--mingling_cli/src/linter.rs65
-rw-r--r--mingling_cli/src/linter/cmd_ra_lints.rs63
2 files changed, 64 insertions, 64 deletions
diff --git a/mingling_cli/src/linter.rs b/mingling_cli/src/linter.rs
index 3b7069d..45111b6 100644
--- a/mingling_cli/src/linter.rs
+++ b/mingling_cli/src/linter.rs
@@ -1,67 +1,4 @@
-use mingling::{
- macros::{chain, dispatcher, entry, metadata},
- metadata::Description,
-};
-
-use crate::{linter::cmd_lint::EntryLint, metadata::setup::ResUsingJson};
-
pub mod cmd_lint;
+pub mod cmd_ra_lints;
pub mod mlint_attr;
pub mod mlint_report;
-
-// Aliases
-
-dispatcher!("ra-lint-clippy",
- CMDLinterSupportRustAnalyzerWithClippy => EntryLinterSupportRustAnalyzerWithClippy
-);
-
-dispatcher!("ra-lint-check",
- CMDLinterSupportRustAnalyzerWithCheck => EntryLinterSupportRustAnalyzerWithCheck
-);
-
-dispatcher!("ra-lint",
- CMDLinterSupportRustAnalyzer => EntryLinterSupportRustAnalyzer
-);
-
-#[chain]
-pub fn handle_ra_lint(_: EntryLinterSupportRustAnalyzer, use_json: &mut ResUsingJson) -> EntryLint {
- use_json.using = true;
- entry!("--message-format=json")
-}
-
-#[chain]
-pub fn handle_ra_lint_check(
- _: EntryLinterSupportRustAnalyzerWithCheck,
- use_json: &mut ResUsingJson,
-) -> EntryLint {
- use_json.using = true;
- entry!("--message-format=json", "--with-checker=cargo,check")
-}
-
-#[chain]
-pub fn handle_ra_lint_clippy(
- _: EntryLinterSupportRustAnalyzerWithClippy,
- use_json: &mut ResUsingJson,
-) -> EntryLint {
- use_json.using = true;
- entry!("--message-format=json", "--with-checker=cargo,clippy")
-}
-
-#[metadata(EntryLinterSupportRustAnalyzer)]
-pub fn desc_ra_lint() -> Description {
- "Run `mling lint` and output the results".to_string().into()
-}
-
-#[metadata(EntryLinterSupportRustAnalyzerWithCheck)]
-pub fn desc_ra_lint_check() -> Description {
- "Run `mling lint` and `cargo check`, and output the combined results"
- .to_string()
- .into()
-}
-
-#[metadata(EntryLinterSupportRustAnalyzerWithClippy)]
-pub fn desc_ra_lint_clippy() -> Description {
- "Run `mling lint` and `cargo clippy`, and output the combined results"
- .to_string()
- .into()
-}
diff --git a/mingling_cli/src/linter/cmd_ra_lints.rs b/mingling_cli/src/linter/cmd_ra_lints.rs
new file mode 100644
index 0000000..733d611
--- /dev/null
+++ b/mingling_cli/src/linter/cmd_ra_lints.rs
@@ -0,0 +1,63 @@
+use mingling::{
+ macros::{chain, dispatcher, entry, metadata},
+ metadata::Description,
+};
+
+use crate::{linter::cmd_lint::EntryLint, metadata::setup::ResUsingJson};
+
+// Aliases
+
+dispatcher!("ra-lint-clippy",
+ CMDLinterSupportRustAnalyzerWithClippy => EntryLinterSupportRustAnalyzerWithClippy
+);
+
+dispatcher!("ra-lint-check",
+ CMDLinterSupportRustAnalyzerWithCheck => EntryLinterSupportRustAnalyzerWithCheck
+);
+
+dispatcher!("ra-lint",
+ CMDLinterSupportRustAnalyzer => EntryLinterSupportRustAnalyzer
+);
+
+#[chain]
+pub fn handle_ra_lint(_: EntryLinterSupportRustAnalyzer, use_json: &mut ResUsingJson) -> EntryLint {
+ use_json.using = true;
+ entry!("--message-format=json")
+}
+
+#[chain]
+pub fn handle_ra_lint_check(
+ _: EntryLinterSupportRustAnalyzerWithCheck,
+ use_json: &mut ResUsingJson,
+) -> EntryLint {
+ use_json.using = true;
+ entry!("--message-format=json", "--with-checker=cargo,check")
+}
+
+#[chain]
+pub fn handle_ra_lint_clippy(
+ _: EntryLinterSupportRustAnalyzerWithClippy,
+ use_json: &mut ResUsingJson,
+) -> EntryLint {
+ use_json.using = true;
+ entry!("--message-format=json", "--with-checker=cargo,clippy")
+}
+
+#[metadata(EntryLinterSupportRustAnalyzer)]
+pub fn desc_ra_lint() -> Description {
+ "Run `mling lint` and output the results".to_string().into()
+}
+
+#[metadata(EntryLinterSupportRustAnalyzerWithCheck)]
+pub fn desc_ra_lint_check() -> Description {
+ "Run `mling lint` and `cargo check`, and output the combined results"
+ .to_string()
+ .into()
+}
+
+#[metadata(EntryLinterSupportRustAnalyzerWithClippy)]
+pub fn desc_ra_lint_clippy() -> Description {
+ "Run `mling lint` and `cargo clippy`, and output the combined results"
+ .to_string()
+ .into()
+}