stop ignoring some lint rules that pass ruff check

This commit is contained in:
Lendemor 2024-11-05 15:50:26 +01:00
parent ff66e45d16
commit 8b7d613ed7
8 changed files with 45 additions and 9 deletions

View File

@ -92,7 +92,7 @@ build-backend = "poetry.core.masonry.api"
[tool.ruff] [tool.ruff]
target-version = "py39" target-version = "py39"
lint.select = ["B", "D", "E", "F", "I", "SIM", "W"] lint.select = ["B", "D", "E", "F", "I", "SIM", "W"]
lint.ignore = ["B008", "D203", "D205", "D213", "D401", "D406", "D407", "E501", "F403", "F405", "F541", "SIM115"] lint.ignore = ["B008", "D205", "E501", "F403", "F541", "SIM115"]
lint.pydocstyle.convention = "google" lint.pydocstyle.convention = "google"
[tool.ruff.lint.per-file-ignores] [tool.ruff.lint.per-file-ignores]

View File

@ -156,7 +156,6 @@ class ComponentNamespace(SimpleNamespace):
def __hash__(self) -> int: def __hash__(self) -> int:
"""Get the hash of the namespace. """Get the hash of the namespace.
Returns: Returns:
The hash of the namespace. The hash of the namespace.
""" """

View File

@ -26,7 +26,6 @@ from reflex.vars.sequence import StringVar, string_replace_operation
def copy_script() -> Any: def copy_script() -> Any:
"""Copy script for the code block and modify the child SVG element. """Copy script for the code block and modify the child SVG element.
Returns: Returns:
Any: The result of calling the script. Any: The result of calling the script.
""" """

View File

@ -191,7 +191,6 @@ def ask(
def progress(): def progress():
"""Create a new progress bar. """Create a new progress bar.
Returns: Returns:
A new progress bar. A new progress bar.
""" """

View File

@ -102,7 +102,6 @@ def server_side_event(tmp_path_factory) -> Generator[AppHarness, None, None]:
def driver(server_side_event: AppHarness): def driver(server_side_event: AppHarness):
"""Get an instance of the browser open to the server_side_event app. """Get an instance of the browser open to the server_side_event app.
Args: Args:
server_side_event: harness for ServerSideEvent app server_side_event: harness for ServerSideEvent app

View File

@ -0,0 +1,44 @@
import time
from typing import Generator
import pytest
from playwright.sync_api import Page
from reflex.testing import AppHarness
def RouterDataApp():
"""App using router data."""
import reflex as rx
app = rx.App(state=rx.State)
@app.add_page
def index():
return rx.text(rx.State.router.session.client_token)
@pytest.fixture()
def router_app(tmp_path_factory) -> Generator[AppHarness, None, None]:
"""Start Table app at tmp_path via AppHarness.
Args:
tmp_path_factory: pytest tmp_path_factory fixture
Yields:
running AppHarness instance
"""
with AppHarness.create(
root=tmp_path_factory.mktemp("table"),
app_source=RouterDataApp, # type: ignore
) as harness:
assert harness.app_instance is not None, "app is not running"
yield harness
def test_router_data(router_app: AppHarness, page: Page):
assert router_app.frontend_url is not None
page.goto(router_app.frontend_url)
time.sleep(5)

View File

@ -41,7 +41,6 @@ class S(BaseState):
def on_change(self, v: str): def on_change(self, v: str):
"""Dummy on_change handler. """Dummy on_change handler.
Args: Args:
v: The changed value. v: The changed value.
""" """

View File

@ -20,7 +20,6 @@ from reflex.vars.base import LiteralVar
def test_has_serializer(type_: Type, expected: bool): def test_has_serializer(type_: Type, expected: bool):
"""Test that has_serializer returns the correct value. """Test that has_serializer returns the correct value.
Args: Args:
type_: The type to check. type_: The type to check.
expected: The expected result. expected: The expected result.
@ -41,7 +40,6 @@ def test_has_serializer(type_: Type, expected: bool):
def test_get_serializer(type_: Type, expected: serializers.Serializer): def test_get_serializer(type_: Type, expected: serializers.Serializer):
"""Test that get_serializer returns the correct value. """Test that get_serializer returns the correct value.
Args: Args:
type_: The type to check. type_: The type to check.
expected: The expected result. expected: The expected result.
@ -195,7 +193,6 @@ class BaseSubclass(Base):
def test_serialize(value: Any, expected: str): def test_serialize(value: Any, expected: str):
"""Test that serialize returns the correct value. """Test that serialize returns the correct value.
Args: Args:
value: The value to serialize. value: The value to serialize.
expected: The expected result. expected: The expected result.