refactor: replace isort, black and flake8 with ruff (#1346)
Some checks are pending
Docs - build & deploy / docs (push) Waiting to run
Run tests / build (ubuntu-latest, 3.10) (push) Waiting to run
Run tests / build (ubuntu-latest, 3.11) (push) Waiting to run
Run tests / build (ubuntu-latest, 3.12) (push) Waiting to run
Run tests / build (ubuntu-latest, 3.13) (push) Waiting to run
Run tests / build (ubuntu-latest, 3.8) (push) Waiting to run
Run tests / test_sampleproject (3.13) (push) Waiting to run
Run tests / build (ubuntu-latest, 3.9) (push) Waiting to run
Run tests / build (windows-latest, 3.10) (push) Waiting to run
Run tests / build (windows-latest, 3.11) (push) Waiting to run
Run tests / build (windows-latest, 3.12) (push) Waiting to run
Run tests / build (windows-latest, 3.13) (push) Waiting to run
Run tests / build (windows-latest, 3.8) (push) Waiting to run
Run tests / build (windows-latest, 3.9) (push) Waiting to run
Run tests / test_docs (3.13) (push) Waiting to run

This commit is contained in:
Juro Oravec 2025-09-10 14:06:53 +02:00 committed by GitHub
parent 5279fd372a
commit f100cc1836
No known key found for this signature in database
GPG key ID: B5690EEEBB952194
128 changed files with 3076 additions and 2599 deletions

View file

@ -32,9 +32,9 @@ if not settings.configured:
"OPTIONS": {
"builtins": [
"django_components.templatetags.component_tags",
]
],
},
}
},
],
COMPONENTS={
"autodiscover": False,
@ -45,9 +45,9 @@ if not settings.configured:
"default": {
"ENGINE": "django.db.backends.sqlite3",
"NAME": ":memory:",
}
},
},
SECRET_KEY="secret",
SECRET_KEY="secret", # noqa: S106
ROOT_URLCONF="django_components.urls",
)
@ -68,10 +68,10 @@ def lazy_load_template(template: str) -> Template:
template_hash = hash(template)
if template_hash in templates_cache:
return templates_cache[template_hash]
else:
template_instance = Template(template)
templates_cache[template_hash] = template_instance
return template_instance
template_instance = Template(template)
templates_cache[template_hash] = template_instance
return template_instance
#####################################
@ -156,7 +156,7 @@ _secondary_btn_styling = "ring-1 ring-inset"
theme = Theme(
default=ThemeStylingVariant(
primary=ThemeStylingUnit(
color="bg-blue-600 text-white hover:bg-blue-500 focus-visible:outline-blue-600 transition"
color="bg-blue-600 text-white hover:bg-blue-500 focus-visible:outline-blue-600 transition",
),
primary_disabled=ThemeStylingUnit(color="bg-blue-300 text-blue-50 focus-visible:outline-blue-600 transition"),
secondary=ThemeStylingUnit(
@ -268,7 +268,7 @@ class Button(Component):
disabled: Optional[bool] = False,
variant: Union["ThemeVariant", Literal["plain"]] = "primary",
color: Union["ThemeColor", str] = "default",
type: Optional[str] = "button",
type: Optional[str] = "button", # noqa: A002
attrs: Optional[dict] = None,
):
common_css = (
@ -336,6 +336,7 @@ class Button(Component):
from django_components.testing import djc_test # noqa: E402
@djc_test
def test_render(snapshot):
data = gen_render_data()