Skip to content

Commit 4a2f2a9

Browse files
committedJan 25, 2025·
refactor(linter): move default all_rules output to trait (#8710)
1 parent 33de70a commit 4a2f2a9

File tree

5 files changed

+3
-17
lines changed

5 files changed

+3
-17
lines changed
 

‎apps/oxlint/src/output_formatter/checkstyle.rs

-4
Original file line numberDiff line numberDiff line change
@@ -13,10 +13,6 @@ use crate::output_formatter::InternalFormatter;
1313
pub struct CheckStyleOutputFormatter;
1414

1515
impl InternalFormatter for CheckStyleOutputFormatter {
16-
fn all_rules(&self) -> Option<String> {
17-
None
18-
}
19-
2016
fn get_diagnostic_reporter(&self) -> Box<dyn DiagnosticReporter> {
2117
Box::new(CheckstyleReporter::default())
2218
}

‎apps/oxlint/src/output_formatter/github.rs

-4
Original file line numberDiff line numberDiff line change
@@ -11,10 +11,6 @@ use crate::output_formatter::InternalFormatter;
1111
pub struct GithubOutputFormatter;
1212

1313
impl InternalFormatter for GithubOutputFormatter {
14-
fn all_rules(&self) -> Option<String> {
15-
None
16-
}
17-
1814
fn get_diagnostic_reporter(&self) -> Box<dyn DiagnosticReporter> {
1915
Box::new(GithubReporter)
2016
}

‎apps/oxlint/src/output_formatter/mod.rs

+3-1
Original file line numberDiff line numberDiff line change
@@ -62,7 +62,9 @@ pub struct LintCommandInfo {
6262
/// The Formatter is then managed by [`OutputFormatter`].
6363
trait InternalFormatter {
6464
/// Print all available rules by oxlint
65-
fn all_rules(&self) -> Option<String>;
65+
fn all_rules(&self) -> Option<String> {
66+
None
67+
}
6668

6769
/// At the end of the Lint command the Formatter can output extra information.
6870
fn lint_command_info(&self, _lint_command_info: &LintCommandInfo) -> Option<String> {

‎apps/oxlint/src/output_formatter/stylish.rs

-4
Original file line numberDiff line numberDiff line change
@@ -10,10 +10,6 @@ use crate::output_formatter::InternalFormatter;
1010
pub struct StylishOutputFormatter;
1111

1212
impl InternalFormatter for StylishOutputFormatter {
13-
fn all_rules(&self) -> Option<String> {
14-
None
15-
}
16-
1713
fn get_diagnostic_reporter(&self) -> Box<dyn DiagnosticReporter> {
1814
Box::new(StylishReporter::default())
1915
}

‎apps/oxlint/src/output_formatter/unix.rs

-4
Original file line numberDiff line numberDiff line change
@@ -11,10 +11,6 @@ use crate::output_formatter::InternalFormatter;
1111
pub struct UnixOutputFormatter;
1212

1313
impl InternalFormatter for UnixOutputFormatter {
14-
fn all_rules(&self) -> Option<String> {
15-
None
16-
}
17-
1814
fn get_diagnostic_reporter(&self) -> Box<dyn DiagnosticReporter> {
1915
Box::new(UnixReporter::default())
2016
}

0 commit comments

Comments
 (0)
Please sign in to comment.