mirror of
https://github.com/astral-sh/ruff.git
synced 2025-09-30 22:01:47 +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
|
@ -264,7 +264,7 @@ fn resolve_configuration(
|
|||
let options = pyproject::load_options(&path)?;
|
||||
|
||||
let project_root = relativity.resolve(&path);
|
||||
let configuration = Configuration::from_options(options, &path, &project_root)?;
|
||||
let configuration = Configuration::from_options(options, Some(&path), &project_root)?;
|
||||
|
||||
// If extending, continue to collect.
|
||||
next = configuration.extend.as_ref().map(|extend| {
|
||||
|
|
Loading…
Add table
Add a link
Reference in a new issue