mirror of https://github.com/astral-sh/ruff
[refurb] Make example error out-of-the-box (FURB177) (#19309)
<!-- Thank you for contributing to Ruff/ty! To help us out with reviewing, please consider the following: - Does this pull request include a summary of the change? (See below.) - Does this pull request include a descriptive title? (Please prefix with `[ty]` for ty pull requests.) - Does this pull request include references to any relevant issues? --> ## Summary Part of #18972 This PR makes [implicit-cwd(FURB177)](https://docs.astral.sh/ruff/rules/implicit-cwd/)'s example error out-of-the-box. [Old example](https://play.ruff.rs/a0bef229-9626-426f-867f-55cb95ee64d8) ```python cwd = Path().resolve() ``` [New example](https://play.ruff.rs/bdbea4af-e276-4603-a1b6-88757dfaa399) ```python from pathlib import Path cwd = Path().resolve() ``` <!-- What's the purpose of the change? What does it do, and why? --> ## Test Plan <!-- How was it tested? --> N/A, no functionality/tests affected
This commit is contained in:
parent
021a70d30c
commit
a4562ac673
|
|
@ -14,11 +14,15 @@ use crate::{checkers::ast::Checker, importer::ImportRequest};
|
|||
///
|
||||
/// ## Example
|
||||
/// ```python
|
||||
/// from pathlib import Path
|
||||
///
|
||||
/// cwd = Path().resolve()
|
||||
/// ```
|
||||
///
|
||||
/// Use instead:
|
||||
/// ```python
|
||||
/// from pathlib import Path
|
||||
///
|
||||
/// cwd = Path.cwd()
|
||||
/// ```
|
||||
///
|
||||
|
|
|
|||
Loading…
Reference in New Issue