Skip to content

Commit 0dd4ad3

Browse files
author
Goodspoken
committed
fix(ci): fix all eslint and ruff errors
- SettingsModal: correct eslint-disable rule name for setState in effect - LanguageContext, ThemeContext: suppress react-refresh/only-export-components - HomePage: correct eslint-disable rule name - useBoardStore: replace 'any' with 'string' in TranslateFn - backend/main.py: noqa for intentional late import - backend/tests: noqa for sys import order, remove unused token variable - alembic/initial_schema: remove unused op/sa imports (auto-fixed by ruff)
1 parent c1a6725 commit 0dd4ad3

8 files changed

Lines changed: 14 additions & 12 deletions

File tree

backend/alembic/versions/5ed452d1da2d_initial_schema.py

Lines changed: 0 additions & 2 deletions
Original file line numberDiff line numberDiff line change
@@ -7,8 +7,6 @@
77
"""
88
from typing import Sequence, Union
99

10-
from alembic import op
11-
import sqlalchemy as sa
1210

1311

1412
# revision identifiers, used by Alembic.

backend/main.py

Lines changed: 2 additions & 2 deletions
Original file line numberDiff line numberDiff line change
@@ -213,7 +213,7 @@ def print_lan_qr():
213213
qr = qrcode.QRCode(version=1, box_size=10, border=2)
214214
qr.add_data(url)
215215
qr.make(fit=True)
216-
print(f"\n\033[1;32m=== Scan to connect to ClayTablet ===\033[0m")
216+
print("\n\033[1;32m=== Scan to connect to ClayTablet ===\033[0m")
217217
print(f"URL: \033[1;36m{url}\033[0m\n")
218218
qr.print_ascii(invert=True)
219219
print("\n")
@@ -284,7 +284,7 @@ async def broadcast_sync(room_id: str):
284284
rooms.pop(room_id, None)
285285

286286
# --- Auth Dependency ---
287-
from auth import router as auth_router, get_current_user_id_sync
287+
from auth import router as auth_router, get_current_user_id_sync # noqa: E402
288288

289289
app.include_router(auth_router)
290290

backend/tests/test_api.py

Lines changed: 2 additions & 2 deletions
Original file line numberDiff line numberDiff line change
@@ -9,7 +9,7 @@
99
# DATA_DIR is set by conftest.py before this file is imported
1010
TEST_DATA_DIR = os.environ["DATA_DIR"]
1111

12-
import sys
12+
import sys # noqa: E402
1313
sys.path.insert(0, os.path.dirname(os.path.dirname(__file__)))
1414

1515
# Now import - database.py will use our TEST_DATA_DIR (set by conftest.py)
@@ -302,7 +302,7 @@ def _set_room_owner(self, room_id: str, owner_id: str):
302302
db.close()
303303

304304
def test_personal_room_requires_auth(self, client):
305-
token = self._create_user_and_token(client)
305+
self._create_user_and_token(client)
306306
self._set_room_owner(self.ROOM, self.USER_ID)
307307

308308
# Без авторизации → 403 (не 401!)

frontend/src/components/SettingsModal.tsx

Lines changed: 6 additions & 5 deletions
Original file line numberDiff line numberDiff line change
@@ -31,11 +31,12 @@ export function SettingsModal({ isOpen, currentSettings, onClose, onClearAll, on
3131
];
3232

3333
useEffect(() => {
34-
if (isOpen) {
35-
getCliToken().then(setCliToken);
36-
setCustomServerInput(getBaseUrl());
37-
setUsingCustomServer(isUsingCustomServer());
38-
}
34+
if (!isOpen) return;
35+
getCliToken().then(setCliToken);
36+
// eslint-disable-next-line react-hooks/set-state-in-effect
37+
setCustomServerInput(getBaseUrl());
38+
// eslint-disable-next-line react-hooks/set-state-in-effect
39+
setUsingCustomServer(isUsingCustomServer());
3940
}, [isOpen]);
4041

4142
useEffect(() => {

frontend/src/contexts/LanguageContext.tsx

Lines changed: 1 addition & 0 deletions
Original file line numberDiff line numberDiff line change
@@ -1,3 +1,4 @@
1+
/* eslint-disable react-refresh/only-export-components */
12
import React, { createContext, useContext, useState } from 'react';
23
import { translations, type Language } from '../i18n';
34

frontend/src/contexts/ThemeContext.tsx

Lines changed: 1 addition & 0 deletions
Original file line numberDiff line numberDiff line change
@@ -1,3 +1,4 @@
1+
/* eslint-disable react-refresh/only-export-components */
12
import React, { createContext, useContext, useState, useEffect } from 'react';
23

34
type Theme = 'light' | 'dark';

frontend/src/pages/HomePage.tsx

Lines changed: 1 addition & 0 deletions
Original file line numberDiff line numberDiff line change
@@ -30,6 +30,7 @@ export default function HomePage() {
3030
// Load user's rooms when user becomes available
3131
useEffect(() => {
3232
if (!user) return;
33+
// eslint-disable-next-line react-hooks/set-state-in-effect
3334
setRoomsLoading(true);
3435
api.getMyRooms()
3536
.then((rooms: { id: string; ttl: string; last_activity?: string }[]) => {

frontend/src/stores/useBoardStore.ts

Lines changed: 1 addition & 1 deletion
Original file line numberDiff line numberDiff line change
@@ -6,7 +6,7 @@ import * as api from '../api';
66

77
// ---- Types ----
88
type ToastFn = (message: string, type?: 'success' | 'error' | 'info') => void;
9-
type TranslateFn = (key: any) => string;
9+
type TranslateFn = (key: string) => string;
1010

1111
interface BoardState {
1212
// Room data

0 commit comments

Comments
 (0)