mirror of
https://github.com/astral-sh/ruff.git
synced 2025-09-29 13:25:17 +00:00

## Summary Implement [`no-implicit-cwd`](https://github.com/dosisod/refurb/blob/master/docs/checks.md#furb177-no-implicit-cwd) as `implicit-cwd` Related to #1348. ## Test Plan `cargo test`
31 lines
601 B
Python
31 lines
601 B
Python
import pathlib
|
|
from pathlib import Path
|
|
|
|
# Errors
|
|
_ = Path().resolve()
|
|
_ = pathlib.Path().resolve()
|
|
|
|
_ = Path("").resolve()
|
|
_ = pathlib.Path("").resolve()
|
|
|
|
_ = Path(".").resolve()
|
|
_ = pathlib.Path(".").resolve()
|
|
|
|
_ = Path("", **kwargs).resolve()
|
|
_ = pathlib.Path("", **kwargs).resolve()
|
|
|
|
_ = Path(".", **kwargs).resolve()
|
|
_ = pathlib.Path(".", **kwargs).resolve()
|
|
|
|
# OK
|
|
_ = Path.cwd()
|
|
_ = pathlib.Path.cwd()
|
|
|
|
_ = Path("foo").resolve()
|
|
_ = pathlib.Path("foo").resolve()
|
|
|
|
_ = Path(".", "foo").resolve()
|
|
_ = pathlib.Path(".", "foo").resolve()
|
|
|
|
_ = Path(*args).resolve()
|
|
_ = pathlib.Path(*args).resolve()
|