Avoid imports from criterion

This commit is contained in:
Micha Reiser 2025-03-17 09:06:11 +01:00
parent 7541dbd7bf
commit 95c66b184b
No known key found for this signature in database
5 changed files with 14 additions and 6 deletions

View file

@ -1,4 +1,6 @@
use ruff_benchmark::criterion::{
use ruff_benchmark::criterion;
use criterion::{
criterion_group, criterion_main, measurement::WallTime, BenchmarkId, Criterion, Throughput,
};
use ruff_benchmark::{

View file

@ -1,4 +1,6 @@
use ruff_benchmark::criterion::{
use ruff_benchmark::criterion;
use criterion::{
criterion_group, criterion_main, BenchmarkGroup, BenchmarkId, Criterion, Throughput,
};
use ruff_benchmark::{

View file

@ -1,4 +1,6 @@
use ruff_benchmark::criterion::{
use ruff_benchmark::criterion;
use criterion::{
criterion_group, criterion_main, measurement::WallTime, BenchmarkId, Criterion, Throughput,
};
use ruff_benchmark::{

View file

@ -1,21 +1,23 @@
#![allow(clippy::disallowed_names)]
use ruff_benchmark::criterion;
use std::borrow::Cow;
use std::ops::Range;
use criterion::{criterion_group, criterion_main, BatchSize, Criterion};
use rayon::ThreadPoolBuilder;
use rustc_hash::FxHashSet;
use red_knot_project::metadata::options::{EnvironmentOptions, Options};
use red_knot_project::metadata::value::RangedValue;
use red_knot_project::watch::{ChangeEvent, ChangedKind};
use red_knot_project::{Db, ProjectDatabase, ProjectMetadata};
use ruff_benchmark::criterion::{criterion_group, criterion_main, BatchSize, Criterion};
use ruff_benchmark::TestFile;
use ruff_db::diagnostic::{DiagnosticId, OldDiagnosticTrait, Severity};
use ruff_db::files::{system_path_to_file, File};
use ruff_db::source::source_text;
use ruff_db::system::{MemoryFileSystem, SystemPath, SystemPathBuf, TestSystem};
use ruff_python_ast::PythonVersion;
use rustc_hash::FxHashSet;
struct Case {
db: ProjectDatabase,

View file

@ -235,8 +235,8 @@ impl SubDiagnostic {
///
/// If a sub-diagnostic has not been marked as printed before being
/// dropped, then its `Drop` implementation will panic in debug mode.
#[cfg(debug_assertions)]
pub(crate) fn printed(&mut self) {
#[cfg(debug_assertions)]
{
self.inner.printed = true;
}