Skip to content

Commit 243372e

Browse files
linting
1 parent a6d2d8b commit 243372e

File tree

12 files changed

+25
-23
lines changed

12 files changed

+25
-23
lines changed

.pre-commit-config.yaml

Lines changed: 1 addition & 1 deletion
Original file line numberDiff line numberDiff line change
@@ -17,7 +17,7 @@ repos:
1717
hooks:
1818
- id: ty
1919
name: ty
20-
entry: uv run --all-extras ty check .
20+
entry: uv run --all-extras ty check src/
2121
language: system
2222
types: [python]
2323
pass_filenames: false

site/manage.py

Lines changed: 2 additions & 1 deletion
Original file line numberDiff line numberDiff line change
@@ -1,13 +1,14 @@
11
#!/usr/bin/env python
22
"""Django's command-line utility for administrative tasks."""
3+
34
import os
45
import sys
56

67

78
def main():
89
os.environ.setdefault("DJANGO_SETTINGS_MODULE", "project.settings")
910
try:
10-
from django.core.management import execute_from_command_line
11+
from django.core.management import execute_from_command_line # noqa: PLC0415
1112
except ImportError as exc:
1213
raise ImportError(
1314
"Couldn't import Django. Are you sure it's installed and "

site/project/settings.py

Lines changed: 1 addition & 1 deletion
Original file line numberDiff line numberDiff line change
@@ -11,7 +11,7 @@
1111
SECRET_KEY = os.getenv("SECRET_KEY")
1212
DEBUG = True
1313

14-
ALLOWED_HOSTS = ["localhost", "127.0.0.1", "0.0.0.0", "django-unicorn.com", "www.django-unicorn.com"]
14+
ALLOWED_HOSTS = ["localhost", "127.0.0.1", "0.0.0.0", "django-unicorn.com", "www.django-unicorn.com"] # noqa: S104
1515

1616
ALLOWED_HOST = os.getenv("ALLOWED_HOST")
1717

site/project/urls.py

Lines changed: 1 addition & 3 deletions
Original file line numberDiff line numberDiff line change
@@ -1,8 +1,6 @@
1-
from django.urls import path, include
2-
1+
from django.urls import include, path
32
from www import urls as www_urls
43

5-
64
urlpatterns = [
75
path("", include(www_urls)),
86
path("unicorn/", include("django_unicorn.urls")),

site/unicorn/components/select.py

Lines changed: 3 additions & 1 deletion
Original file line numberDiff line numberDiff line change
@@ -1,9 +1,11 @@
1+
from typing import ClassVar
2+
13
from django_unicorn.components import UnicornView
24

35

46
class SelectView(UnicornView):
57
selected_fruit = ""
6-
fruits = [
8+
fruits: ClassVar[list] = [
79
"Apple",
810
"Grape",
911
"Banana",

site/unicorn/components/todo.py

Lines changed: 3 additions & 1 deletion
Original file line numberDiff line numberDiff line change
@@ -1,9 +1,11 @@
1+
from typing import ClassVar
2+
13
from django_unicorn.components import UnicornView
24

35

46
class TodoView(UnicornView):
57
task = ""
6-
tasks = []
8+
tasks: ClassVar[list] = []
79

810
def add(self):
911
self.tasks.append(self.task)

site/unicorn/components/todo_bulma.py

Lines changed: 5 additions & 2 deletions
Original file line numberDiff line numberDiff line change
@@ -1,6 +1,9 @@
1-
from django_unicorn.components import UnicornView
1+
from typing import ClassVar
2+
23
from django import forms
34

5+
from django_unicorn.components import UnicornView
6+
47

58
class TodoForm(forms.Form):
69
task = forms.CharField(min_length=2, max_length=20, required=True)
@@ -10,7 +13,7 @@ class TodoBulmaView(UnicornView):
1013
form_class = TodoForm
1114

1215
task = ""
13-
tasks = []
16+
tasks: ClassVar[list] = []
1417

1518
def add(self):
1619
if self.is_valid():

site/unicorn/components/validation.py

Lines changed: 2 additions & 2 deletions
Original file line numberDiff line numberDiff line change
@@ -1,8 +1,8 @@
1-
from django_unicorn.components import UnicornView
2-
31
from django import forms
42
from django.utils import timezone
53

4+
from django_unicorn.components import UnicornView
5+
66

77
class ValidationForm(forms.Form):
88
text = forms.CharField(min_length=3, max_length=10)

site/www/templatetags/utils.py

Lines changed: 1 addition & 3 deletions
Original file line numberDiff line numberDiff line change
@@ -1,7 +1,5 @@
1-
from django import template
2-
31
from cache_memoize import cache_memoize
4-
2+
from django import template
53

64
register = template.Library()
75

site/www/urls.py

Lines changed: 1 addition & 2 deletions
Original file line numberDiff line numberDiff line change
@@ -1,7 +1,6 @@
11
from django.urls import include, path, re_path
22
from django.views.generic.base import RedirectView
3-
4-
from . import views
3+
from www import views
54

65
app_name = "www"
76

0 commit comments

Comments
 (0)