Skip to content

Commit af0fea6

Browse files
committed
Remove prototype usage from linter
1 parent 7faebf8 commit af0fea6

File tree

2 files changed

+5
-4
lines changed

2 files changed

+5
-4
lines changed

crates/ruff_linter/src/linter.rs

Lines changed: 0 additions & 4 deletions
Original file line numberDiff line numberDiff line change
@@ -32,7 +32,6 @@ use crate::rules::ruff::rules::test_rules::{self, TEST_RULES, TestRule};
3232
use crate::settings::types::UnsafeFixes;
3333
use crate::settings::{LinterSettings, TargetVersion, flags};
3434
use crate::source_kind::SourceKind;
35-
use crate::suppression::Suppressions;
3635
use crate::{Locator, directives, fs};
3736

3837
pub(crate) mod float;
@@ -139,9 +138,6 @@ pub fn check_path(
139138
let tokens = parsed.tokens();
140139
let comment_ranges = indexer.comment_ranges();
141140

142-
// Gather all ruff:directive suppressions
143-
let _suppressions = Suppressions::from_tokens(locator.contents(), tokens);
144-
145141
// Collect doc lines. This requires a rare mix of tokens (for comments) and AST
146142
// (for docstrings), which demands special-casing at this level.
147143
let use_doc_lines = context.is_rule_enabled(Rule::DocLineTooLong);

crates/ruff_linter/src/suppression.rs

Lines changed: 5 additions & 0 deletions
Original file line numberDiff line numberDiff line change
@@ -9,6 +9,7 @@ use ruff_python_trivia::{Cursor, is_python_whitespace};
99
use ruff_text_size::{Ranged, TextLen, TextRange, TextSize, TextSlice};
1010
use smallvec::{SmallVec, smallvec};
1111

12+
#[allow(unused)]
1213
#[derive(Clone, Debug, Eq, PartialEq)]
1314
enum SuppressionAction {
1415
Disable,
@@ -30,6 +31,7 @@ pub(crate) struct SuppressionComment {
3031
reason: TextRange,
3132
}
3233

34+
#[allow(unused)]
3335
impl SuppressionComment {
3436
/// Return the suppressed codes as strings
3537
fn codes_as_str<'src>(&self, source: &'src str) -> impl Iterator<Item = &'src str> {
@@ -46,6 +48,7 @@ pub(crate) struct PendingSuppressionComment<'a> {
4648
comment: SuppressionComment,
4749
}
4850

51+
#[allow(unused)]
4952
impl PendingSuppressionComment<'_> {
5053
/// Whether the comment "matches" another comment, based on indentation and suppressed codes
5154
fn matches(&self, other: &PendingSuppressionComment, source: &str) -> bool {
@@ -74,6 +77,7 @@ pub(crate) struct Suppression {
7477
comments: SmallVec<[SuppressionComment; 2]>,
7578
}
7679

80+
#[allow(unused)]
7781
#[derive(Copy, Clone, Debug)]
7882
pub(crate) enum InvalidSuppressionKind {
7983
/// Trailing suppression not supported
@@ -106,6 +110,7 @@ pub(crate) struct Suppressions {
106110
errors: Vec<ParseError>,
107111
}
108112

113+
#[allow(unused)]
109114
impl Suppressions {
110115
pub(crate) fn from_tokens(source: &str, tokens: &Tokens) -> Suppressions {
111116
let builder = SuppressionsBuilder::new(source);

0 commit comments

Comments
 (0)