enable REFURB rules in ruff (#4466)
Co-authored-by: Masen Furer <m_github@0x26.net>
This commit is contained in:
parent
2520c51aaf
commit
fd0fd2c6d4
@ -93,7 +93,7 @@ build-backend = "poetry.core.masonry.api"
|
||||
[tool.ruff]
|
||||
target-version = "py39"
|
||||
lint.isort.split-on-trailing-comma = false
|
||||
lint.select = ["B", "D", "E", "F", "I", "SIM", "W", "RUF"]
|
||||
lint.select = ["B", "D", "E", "F", "I", "SIM", "W", "RUF", "FURB"]
|
||||
lint.ignore = ["B008", "D205", "E501", "F403", "SIM115", "RUF006", "RUF012"]
|
||||
lint.pydocstyle.convention = "google"
|
||||
|
||||
|
@ -495,7 +495,7 @@ def initialize_requirements_txt():
|
||||
try:
|
||||
other_requirements_exist = False
|
||||
with open(fp, "r", encoding=encoding) as f:
|
||||
for req in f.readlines():
|
||||
for req in f:
|
||||
# Check if we have a package name that is reflex
|
||||
if re.match(r"^reflex[^a-zA-Z0-9]", req):
|
||||
console.debug(f"{fp} already has reflex as dependency.")
|
||||
|
@ -24,7 +24,7 @@ from reflex.vars.base import Var
|
||||
|
||||
logger = logging.getLogger("pyi_generator")
|
||||
|
||||
PWD = Path(".").resolve()
|
||||
PWD = Path.cwd()
|
||||
|
||||
EXCLUDED_FILES = [
|
||||
"app.py",
|
||||
|
@ -206,7 +206,7 @@ class chdir(contextlib.AbstractContextManager):
|
||||
|
||||
def __enter__(self):
|
||||
"""Save current directory and perform chdir."""
|
||||
self._old_cwd.append(Path(".").resolve())
|
||||
self._old_cwd.append(Path.cwd())
|
||||
os.chdir(self.path)
|
||||
|
||||
def __exit__(self, *excinfo):
|
||||
|
@ -298,7 +298,7 @@ def tmp_working_dir(tmp_path):
|
||||
Yields:
|
||||
subdirectory of tmp_path which is now the current working directory.
|
||||
"""
|
||||
old_pwd = Path(".").resolve()
|
||||
old_pwd = Path.cwd()
|
||||
working_dir = tmp_path / "working_dir"
|
||||
working_dir.mkdir()
|
||||
os.chdir(working_dir)
|
||||
|
Loading…
Reference in New Issue
Block a user