Skip to content

Commit 5e42967

Browse files
refactor: remove code for bad issue (e.g. todo/fixme) reporting
1 parent 825561d commit 5e42967

File tree

4 files changed

+2
-207
lines changed

4 files changed

+2
-207
lines changed

Diff for: src/format_report_formatter.rs

+1-1
Original file line numberDiff line numberDiff line change
@@ -146,6 +146,6 @@ fn error_kind_to_snippet_annotation_type(error_kind: &ErrorKind) -> AnnotationTy
146146
| ErrorKind::BadAttr
147147
| ErrorKind::InvalidGlobPattern(_)
148148
| ErrorKind::VersionMismatch => AnnotationType::Error,
149-
ErrorKind::BadIssue(_) | ErrorKind::DeprecatedAttr => AnnotationType::Warning,
149+
ErrorKind::DeprecatedAttr => AnnotationType::Warning,
150150
}
151151
}

Diff for: src/formatting.rs

-14
Original file line numberDiff line numberDiff line change
@@ -13,7 +13,6 @@ use self::newline_style::apply_newline_style;
1313
use crate::comment::{CharClasses, FullCodeCharKind};
1414
use crate::config::{Config, FileName, Verbosity};
1515
use crate::formatting::generated::is_generated_file;
16-
use crate::issues::BadIssueSeeker;
1716
use crate::modules::Module;
1817
use crate::parse::parser::{DirectoryOwnership, Parser, ParserError};
1918
use crate::parse::session::ParseSess;
@@ -332,7 +331,6 @@ impl FormattingError {
332331
ErrorKind::LineOverflow(found, max) => (max, found - max),
333332
ErrorKind::TrailingWhitespace
334333
| ErrorKind::DeprecatedAttr
335-
| ErrorKind::BadIssue(_)
336334
| ErrorKind::BadAttr
337335
| ErrorKind::LostComment
338336
| ErrorKind::LicenseCheck => {
@@ -483,11 +481,9 @@ struct FormatLines<'a> {
483481
cur_line: usize,
484482
newline_count: usize,
485483
errors: Vec<FormattingError>,
486-
issue_seeker: BadIssueSeeker,
487484
line_buffer: String,
488485
current_line_contains_string_literal: bool,
489486
format_line: bool,
490-
allow_issue_seek: bool,
491487
config: &'a Config,
492488
}
493489

@@ -497,7 +493,6 @@ impl<'a> FormatLines<'a> {
497493
skipped_range: &'a [(usize, usize)],
498494
config: &'a Config,
499495
) -> FormatLines<'a> {
500-
let issue_seeker = BadIssueSeeker::new();
501496
FormatLines {
502497
name,
503498
skipped_range,
@@ -506,8 +501,6 @@ impl<'a> FormatLines<'a> {
506501
cur_line: 1,
507502
newline_count: 0,
508503
errors: vec![],
509-
allow_issue_seek: !issue_seeker.is_disabled(),
510-
issue_seeker,
511504
line_buffer: String::with_capacity(config.max_width() * 2),
512505
current_line_contains_string_literal: false,
513506
format_line: config.file_lines().contains_line(name, 1),
@@ -536,13 +529,6 @@ impl<'a> FormatLines<'a> {
536529
continue;
537530
}
538531

539-
if self.allow_issue_seek && self.format_line {
540-
// Add warnings for bad fixmes
541-
if let Some(issue) = self.issue_seeker.inspect(c) {
542-
self.push_err(ErrorKind::BadIssue(issue), false, false);
543-
}
544-
}
545-
546532
if c == '\n' {
547533
self.new_line(kind);
548534
} else {

Diff for: src/issues.rs

-185
This file was deleted.

Diff for: src/lib.rs

+1-7
Original file line numberDiff line numberDiff line change
@@ -39,7 +39,6 @@ use thiserror::Error;
3939
use crate::comment::LineClasses;
4040
use crate::emitter::Emitter;
4141
use crate::formatting::{FormatErrorMap, FormattingError, ReportedErrors, SourceFile};
42-
use crate::issues::Issue;
4342
use crate::modules::ModuleResolutionError;
4443
use crate::parse::parser::DirectoryOwnership;
4544
use crate::shape::Indent;
@@ -69,7 +68,6 @@ mod format_report_formatter;
6968
pub(crate) mod formatting;
7069
mod ignore_path;
7170
mod imports;
72-
mod issues;
7371
mod items;
7472
mod lists;
7573
mod macros;
@@ -110,9 +108,6 @@ pub enum ErrorKind {
110108
/// Line ends in whitespace.
111109
#[error("left behind trailing whitespace")]
112110
TrailingWhitespace,
113-
/// TODO or FIXME item without an issue number.
114-
#[error("found {0}")]
115-
BadIssue(Issue),
116111
/// License check has failed.
117112
#[error("license check failed")]
118113
LicenseCheck,
@@ -236,8 +231,7 @@ impl FormatReport {
236231
ErrorKind::LostComment => {
237232
errs.has_unformatted_code_errors = true;
238233
}
239-
ErrorKind::BadIssue(_)
240-
| ErrorKind::LicenseCheck
234+
ErrorKind::LicenseCheck
241235
| ErrorKind::DeprecatedAttr
242236
| ErrorKind::BadAttr
243237
| ErrorKind::VersionMismatch => {

0 commit comments

Comments
 (0)