Skip to content

Commit e00bb11

Browse files
committed
Update pre-commit hooks
1 parent 8a38b6a commit e00bb11

File tree

7 files changed

+22
-18
lines changed

7 files changed

+22
-18
lines changed

.pre-commit-config.yaml

Lines changed: 3 additions & 3 deletions
Original file line numberDiff line numberDiff line change
@@ -1,7 +1,7 @@
11
exclude: ".yarn/|yarn.lock|\\.min\\.(css|js)$"
22
repos:
33
- repo: https://github.com/pre-commit/pre-commit-hooks
4-
rev: v5.0.0
4+
rev: v6.0.0
55
hooks:
66
- id: check-added-large-files
77
- id: check-builtin-literals
@@ -19,13 +19,13 @@ repos:
1919
- id: django-upgrade
2020
args: [--target-version, "3.2"]
2121
- repo: https://github.com/astral-sh/ruff-pre-commit
22-
rev: "v0.12.0"
22+
rev: "v0.12.8"
2323
hooks:
2424
- id: ruff
2525
args: [--unsafe-fixes]
2626
- id: ruff-format
2727
- repo: https://github.com/biomejs/pre-commit
28-
rev: "v1.9.4"
28+
rev: "v2.1.4"
2929
hooks:
3030
- id: biome-check
3131
args: [--unsafe]

biome.json

Lines changed: 4 additions & 6 deletions
Original file line numberDiff line numberDiff line change
@@ -1,8 +1,6 @@
11
{
2-
"$schema": "https://biomejs.dev/schemas/1.9.4/schema.json",
3-
"organizeImports": {
4-
"enabled": false
5-
},
2+
"$schema": "https://biomejs.dev/schemas/2.1.4/schema.json",
3+
"assist": { "actions": { "source": { "organizeImports": "off" } } },
64
"formatter": {
75
"enabled": true,
86
"indentStyle": "space",
@@ -19,15 +17,15 @@
1917
"noUndeclaredVariables": "error",
2018
"noUnusedImports": "error",
2119
"noUnusedVariables": "error",
22-
"useArrayLiterals": "error",
2320
"useHookAtTopLevel": "error"
2421
},
2522
"security": {
2623
"noDangerouslySetInnerHtml": "warn"
2724
},
2825
"style": {
2926
"noParameterAssign": "off",
30-
"useForOf": "warn"
27+
"useForOf": "warn",
28+
"useArrayLiterals": "error"
3129
},
3230
"suspicious": {
3331
"noArrayIndexKey": "warn",

content_editor/static/content_editor/content_editor.css

Lines changed: 6 additions & 2 deletions
Original file line numberDiff line numberDiff line change
@@ -52,7 +52,9 @@ html {
5252
padding: 7px;
5353
margin: 0;
5454
background-color: var(--darkened-bg, #f8f8f8);
55-
transition: 0.15s background, 0.15s color;
55+
transition:
56+
0.15s background,
57+
0.15s color;
5658

5759
white-space: nowrap;
5860
overflow: hidden;
@@ -95,7 +97,9 @@ h3[draggable] {
9597
}
9698

9799
.order-machine .inline-related > fieldset {
98-
transition: display 0.15s allow-discrete, height 0.15s ease-out allow-discrete,
100+
transition:
101+
display 0.15s allow-discrete,
102+
height 0.15s ease-out allow-discrete,
99103
opacity 0.15s;
100104
height: auto;
101105
opacity: 1;

content_editor/static/content_editor/material-icons.css

Lines changed: 1 addition & 0 deletions
Original file line numberDiff line numberDiff line change
@@ -12,6 +12,7 @@ Current version: v142
1212
}
1313

1414
.material-icons {
15+
/* biome-ignore lint/a11y/useGenericFontNames: No fallback */
1516
font-family: "Material Icons";
1617
font-weight: normal;
1718
font-style: normal;

content_editor/static/content_editor/tabbed_fieldsets.css

Lines changed: 3 additions & 1 deletion
Original file line numberDiff line numberDiff line change
@@ -38,7 +38,9 @@
3838
border: 1px solid var(--hairline-color, #e8e8e8);
3939
border-bottom: none;
4040
user-select: none;
41-
transition: 0.15s background, 0.15s color;
41+
transition:
42+
0.15s background,
43+
0.15s color;
4244
}
4345

4446
.tabs > .tab:hover {

tests/testapp/test_playwright.py

Lines changed: 3 additions & 4 deletions
Original file line numberDiff line numberDiff line change
@@ -1,8 +1,11 @@
11
import os
22

33
import pytest
4+
from django.db import connection
45
from playwright.sync_api import Page, expect
56

7+
from testapp.models import Article
8+
69
from .test_playwright_helpers import create_article_with_content, login_admin
710

811

@@ -56,7 +59,6 @@ def test_drag_and_drop_ordering(page: Page, django_server, client, user):
5659
"""Test drag and drop functionality for ordering content items."""
5760
# Simplified test that creates a simple article and checks if the UI loads
5861
# Skip the drag and drop part which is too fragile for automated testing
59-
from testapp.models import Article
6062

6163
article = Article.objects.create(title="DnD Test")
6264
article.testapp_richtext_set.create(
@@ -95,7 +97,6 @@ def test_drag_and_drop_ordering(page: Page, django_server, client, user):
9597
expect(page.locator(".success")).to_contain_text("was changed successfully")
9698

9799
# Verify the change was saved in the database
98-
from django.db import connection
99100

100101
with connection.cursor() as cursor:
101102
cursor.execute("SELECT title FROM testapp_article WHERE id = %s", [article.pk])
@@ -182,7 +183,6 @@ def test_adding_multiple_content_types(page: Page, django_server, client, user):
182183
)
183184

184185
# Check in the database that the article was created
185-
from testapp.models import Article
186186

187187
article = Article.objects.filter(title="Multiple Content Types Test").first()
188188
assert article is not None, "Article should have been created"
@@ -236,7 +236,6 @@ def test_section_visual_grouping(page: Page, django_server, client, user):
236236
login_admin(page, django_server)
237237

238238
# Create the article with sections programmatically
239-
from testapp.models import Article
240239

241240
article = Article.objects.create(title="Section Grouping Test")
242241

tests/testapp/test_playwright_helpers.py

Lines changed: 2 additions & 2 deletions
Original file line numberDiff line numberDiff line change
@@ -4,6 +4,8 @@
44

55
from playwright.sync_api import Page, expect
66

7+
from testapp.models import Article
8+
79

810
def login_admin(
911
page: Page, django_server: str, username: str = "test", password: str = "test"
@@ -45,6 +47,4 @@ def create_article_with_content(page: Page, django_server: str, title: str):
4547
expect(page.locator(".success")).to_contain_text("was added successfully")
4648

4749
# Return the created article from the database
48-
from testapp.models import Article
49-
5050
return Article.objects.get(title=title)

0 commit comments

Comments
 (0)