mirror of
https://github.com/astral-sh/ruff.git
synced 2025-08-03 18:28:24 +00:00
Allow arbitrary configuration options to be overridden via the CLI (#9599)
Fixes #8368 Fixes https://github.com/astral-sh/ruff/issues/9186 ## Summary Arbitrary TOML strings can be provided via the command-line to override configuration options in `pyproject.toml` or `ruff.toml`. As an example: to run over typeshed and respect typeshed's `pyproject.toml`, but override a specific isort setting and enable an additional pep8-naming setting: ``` cargo run -- check ../typeshed --no-cache --config ../typeshed/pyproject.toml --config "lint.isort.combine-as-imports=false" --config "lint.extend-select=['N801']" ``` --------- Co-authored-by: Micha Reiser <micha@reiser.io> Co-authored-by: Zanie Blue <contact@zanie.dev>
This commit is contained in:
parent
b21ba71ef4
commit
8ec56277e9
21 changed files with 1099 additions and 235 deletions
|
@ -108,8 +108,9 @@ impl Workspace {
|
|||
#[wasm_bindgen(constructor)]
|
||||
pub fn new(options: JsValue) -> Result<Workspace, Error> {
|
||||
let options: Options = serde_wasm_bindgen::from_value(options).map_err(into_error)?;
|
||||
let configuration = Configuration::from_options(options, Path::new("."), Path::new("."))
|
||||
.map_err(into_error)?;
|
||||
let configuration =
|
||||
Configuration::from_options(options, Some(Path::new(".")), Path::new("."))
|
||||
.map_err(into_error)?;
|
||||
let settings = configuration
|
||||
.into_settings(Path::new("."))
|
||||
.map_err(into_error)?;
|
||||
|
|
Loading…
Add table
Add a link
Reference in a new issue