Compare commits

...

1 Commits

Author SHA1 Message Date
Lendemor
e692b11e85 asserts in folder reflex/ not allowed anymore 2024-12-04 01:39:35 +01:00
2 changed files with 5 additions and 4 deletions

View File

@ -93,13 +93,13 @@ 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", "S101"]
lint.ignore = ["B008", "D205", "E501", "F403", "SIM115"]
lint.pydocstyle.convention = "google"
[tool.ruff.lint.per-file-ignores]
"__init__.py" = ["F401"]
"tests/*.py" = ["D100", "D103", "D104", "B018"]
"tests/*.py" = ["D100", "D103", "D104", "B018", "S101"]
"reflex/.templates/*.py" = ["D100", "D103", "D104"]
"*.pyi" = ["D301", "D415", "D417", "D418", "E742"]
"*/blank.py" = ["I001"]

View File

@ -46,7 +46,7 @@ def asset(
Raises:
FileNotFoundError: If the file does not exist.
ValueError: If subfolder is provided for local assets.
ValueError: If subfolder is provided for local assets or the module is not found.
Returns:
The relative URL to the asset.
@ -69,7 +69,8 @@ def asset(
frame = inspect.stack()[_stack_level]
calling_file = frame.filename
module = inspect.getmodule(frame[0])
assert module is not None
if module is None:
raise ValueError(f"Module {frame[0]} not found.")
external = constants.Dirs.EXTERNAL_APP_ASSETS
src_file_shared = Path(calling_file).parent / path