mirror of
https://github.com/astral-sh/ruff.git
synced 2025-09-27 12:29:28 +00:00
Deduplicate deprecation warnings for v0.2.0 release (#9764)
## Summary Adds an additional warning macro (we should consolidate these later) that shows a warning once based on the content of the warning itself. This is less efficient than `warn_user_once!` and `warn_user_by_id!`, but this is so expensive that it doesn't matter at all. Applies this macro to the various warnings for the v0.2.0 release, and also includes the filename in said warnings, so the FastAPI case is now: ```text warning: The top-level linter settings are deprecated in favour of their counterparts in the `lint` section. Please update the following options in /Users/crmarsh/workspace/fastapi/pyproject.toml: - 'ignore' -> 'lint.ignore' - 'select' -> 'lint.select' - 'isort' -> 'lint.isort' - 'pyupgrade' -> 'lint.pyupgrade' - 'per-file-ignores' -> 'lint.per-file-ignores' ``` --------- Co-authored-by: Zanie <contact@zanie.dev>
This commit is contained in:
parent
148b64ead3
commit
06ad687efd
7 changed files with 132 additions and 65 deletions
|
@ -108,8 +108,8 @@ 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(".")).map_err(into_error)?;
|
||||
let configuration = Configuration::from_options(options, 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