Skip to content

Commit

Permalink
Remove IO based lints from linter benchmark (#7240)
Browse files Browse the repository at this point in the history
  • Loading branch information
MichaReiser authored Sep 8, 2023
1 parent 0a07a2c commit 9cb5ce7
Showing 1 changed file with 9 additions and 2 deletions.
11 changes: 9 additions & 2 deletions crates/ruff_benchmark/benches/linter.rs
Original file line number Diff line number Diff line change
@@ -1,7 +1,8 @@
use ruff::linter::lint_only;
use ruff::settings::rule_table::RuleTable;
use ruff::settings::{flags, Settings};
use ruff::source_kind::SourceKind;
use ruff::RuleSelector;
use ruff::{registry::Rule, RuleSelector};
use ruff_benchmark::criterion::{
criterion_group, criterion_main, BenchmarkGroup, BenchmarkId, Criterion, Throughput,
};
Expand Down Expand Up @@ -78,8 +79,14 @@ fn benchmark_default_rules(criterion: &mut Criterion) {
}

fn benchmark_all_rules(criterion: &mut Criterion) {
let mut rules: RuleTable = RuleSelector::All.into_iter().collect();

// Disable IO based rules because it is a source of flakiness
rules.disable(Rule::ShebangMissingExecutableFile);
rules.disable(Rule::ShebangNotExecutable);

let settings = Settings {
rules: RuleSelector::All.into_iter().collect(),
rules,
..Settings::default()
};

Expand Down

0 comments on commit 9cb5ce7

Please sign in to comment.