Move Configuration to ruff_workspace crate (#6920)

This commit is contained in:
Micha Reiser 2023-08-28 08:21:35 +02:00 committed by GitHub
parent 039694aaed
commit a6aa16630d
No known key found for this signature in database
GPG key ID: 4AEE18F83AFDEB23
77 changed files with 3704 additions and 4108 deletions

View file

@ -22,6 +22,7 @@ ruff_python_literal = { path = "../ruff_python_literal" }
ruff_python_parser = { path = "../ruff_python_parser" }
ruff_python_stdlib = { path = "../ruff_python_stdlib" }
ruff_python_trivia = { path = "../ruff_python_trivia" }
ruff_workspace = { path = "../ruff_workspace", features = ["schemars"]}
anyhow = { workspace = true }
clap = { workspace = true }

View file

@ -8,7 +8,6 @@ use indicatif::ProgressStyle;
#[cfg_attr(feature = "singlethreaded", allow(unused_imports))]
use rayon::iter::{IntoParallelIterator, ParallelIterator};
use ruff::logging::LogLevel;
use ruff::resolver::python_files_in_path;
use ruff::settings::types::{FilePattern, FilePatternSet};
use ruff_cli::args::{CheckArgs, LogLevelArgs};
use ruff_cli::resolve::resolve;
@ -16,6 +15,7 @@ use ruff_formatter::{FormatError, LineWidth, PrintError};
use ruff_python_formatter::{
format_module, FormatModuleError, MagicTrailingComma, PyFormatOptions,
};
use ruff_workspace::resolver::python_files_in_path;
use serde::Deserialize;
use similar::{ChangeTag, TextDiff};
use std::fmt::{Display, Formatter};

View file

@ -9,8 +9,8 @@ use regex::{Captures, Regex};
use strum::IntoEnumIterator;
use ruff::registry::{Linter, Rule, RuleNamespace};
use ruff::settings::options::Options;
use ruff_diagnostics::AutofixKind;
use ruff_workspace::options::Options;
use crate::ROOT_DIR;

View file

@ -7,10 +7,9 @@ use anyhow::{bail, Result};
use pretty_assertions::StrComparison;
use schemars::schema_for;
use ruff::settings::options::Options;
use crate::generate_all::{Mode, REGENERATE_ALL_COMMAND};
use crate::ROOT_DIR;
use ruff_workspace::options::Options;
#[derive(clap::Args)]
pub(crate) struct Args {

View file

@ -2,9 +2,8 @@
//!
//! Used for <https://beta.ruff.rs/docs/settings/>.
use itertools::Itertools;
use ruff::settings::options::Options;
use ruff::settings::options_base::{OptionEntry, OptionField};
use ruff_workspace::options::Options;
use ruff_workspace::options_base::{OptionEntry, OptionField};
fn emit_field(output: &mut String, name: &str, field: &OptionField, group_name: Option<&str>) {
// if there's a group name, we need to add it to the anchor

View file

@ -6,9 +6,9 @@ use itertools::Itertools;
use strum::IntoEnumIterator;
use ruff::registry::{Linter, Rule, RuleNamespace};
use ruff::settings::options::Options;
use ruff::upstream_categories::UpstreamCategoryAndPrefix;
use ruff_diagnostics::AutofixKind;
use ruff_workspace::options::Options;
const FIX_SYMBOL: &str = "🛠";
const NURSERY_SYMBOL: &str = "🌅";