-
Notifications
You must be signed in to change notification settings - Fork 102
feat: linter suppressions #440
New issue
Have a question about this project? Sign up for a free GitHub account to open an issue and contact its maintainers and the community.
By clicking “Sign up for GitHub”, you agree to our terms of service and privacy statement. We’ll occasionally send you account related emails.
Already on GitHub? Sign in to your account
base: main
Are you sure you want to change the base?
Conversation
@@ -570,6 +570,22 @@ impl Workspace for WorkspaceServer { | |||
}, | |||
)); | |||
|
|||
let suppressions = parser | |||
.document_suppressions() | |||
.clone() |
There was a problem hiding this comment.
Choose a reason for hiding this comment
The reason will be displayed to describe this comment to others. Learn more.
todo: maybe we don't need to clone and can instead pull errored suppressions
} | ||
|
||
#[derive(Debug, PartialEq, Clone, Eq)] | ||
pub(crate) enum RuleSpecifier { |
There was a problem hiding this comment.
Choose a reason for hiding this comment
The reason will be displayed to describe this comment to others. Learn more.
todo: add comment
let leading_whitespace_offset = line.len() - start_trimmed.len(); | ||
let trimmed = start_trimmed.trim_ascii_end(); | ||
|
||
assert!( |
There was a problem hiding this comment.
Choose a reason for hiding this comment
The reason will be displayed to describe this comment to others. Learn more.
todo: add this to function documentation
} | ||
|
||
/// Will parse the suppressions at the start of the file. | ||
/// As soon as anything is encountered that's not a `pgt-ignore-all` |
There was a problem hiding this comment.
Choose a reason for hiding this comment
The reason will be displayed to describe this comment to others. Learn more.
todo: or empty line
let mut eligible = vec![]; | ||
|
||
// one-for-one, we're checking the lines above a diagnostic location | ||
// until there are no more diagnostics |
There was a problem hiding this comment.
Choose a reason for hiding this comment
The reason will be displayed to describe this comment to others. Learn more.
// until there are no more diagnostics | |
// until there are no more suppressions |
} | ||
} | ||
|
||
for (line, suppr) in &self.line_suppressions { |
There was a problem hiding this comment.
Choose a reason for hiding this comment
The reason will be displayed to describe this comment to others. Learn more.
todo: add comment
[package] | ||
authors.workspace = true | ||
categories.workspace = true | ||
description = "<DESCRIPTION>" |
There was a problem hiding this comment.
Choose a reason for hiding this comment
The reason will be displayed to describe this comment to others. Learn more.
add desc?
There was a problem hiding this comment.
Choose a reason for hiding this comment
The reason will be displayed to describe this comment to others. Learn more.
–
No description provided.