enable REFURB rules in ruff

This commit is contained in:
Lendemor 2024-12-03 14:56:42 +01:00
parent c721227a06
commit 17c0a17235
5 changed files with 5 additions and 5 deletions

View File

@ -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"]
lint.select = ["B", "D", "E", "F", "I", "SIM", "W", "FURB"]
lint.ignore = ["B008", "D205", "E501", "F403", "SIM115"]
lint.pydocstyle.convention = "google"

View File

@ -496,7 +496,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.")

View File

@ -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",

View File

@ -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):

View File

@ -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)