Skip to content

Commit a862760

Browse files
committed
lint errors
1 parent d2f7d35 commit a862760

File tree

4 files changed

+28
-9
lines changed

4 files changed

+28
-9
lines changed

.pre-commit-config.yaml

Lines changed: 21 additions & 0 deletions
Original file line numberDiff line numberDiff line change
@@ -0,0 +1,21 @@
1+
# Pre-commit hooks: run the same checks as CI, but only on staged (changed) files.
2+
# Install: pip install pre-commit && pre-commit install
3+
# Run manually: pre-commit run --all-files (lints all); pre-commit run (lints staged only)
4+
# See https://pre-commit.com/
5+
6+
repos:
7+
- repo: local
8+
hooks:
9+
- id: frontend-lint
10+
name: Frontend lint (staged files only)
11+
entry: bash -c 'cd frontend && FILES=(); for f in "$@"; do p="${f#frontend/}"; [[ -f "$p" ]] && FILES+=("$p"); done; [[ ${#FILES[@]} -eq 0 ]] && exit 0; npx eslint --ext .ts,.tsx --fix "${FILES[@]}"'
12+
language: system
13+
files: ^frontend/.*\.(tsx?|jsx?)$
14+
pass_filenames: true
15+
16+
- repo: https://github.com/astral-sh/ruff-pre-commit
17+
rev: v0.8.4
18+
hooks:
19+
- id: ruff
20+
args: [--target-version=py39, --fix]
21+
files: ^server/.*\.py$

frontend/src/pages/Feedback/FeedbackForm.tsx

Lines changed: 1 addition & 1 deletion
Original file line numberDiff line numberDiff line change
@@ -470,6 +470,6 @@ function FeedbackForm({id}: FormProps) {
470470
</section>
471471
</>
472472
);
473-
};
473+
}
474474

475475
export default FeedbackForm;

frontend/src/services/parsing/ParseWithSource.tsx

Lines changed: 1 addition & 1 deletion
Original file line numberDiff line numberDiff line change
@@ -21,7 +21,7 @@ const ParseStringWithLinks: React.FC<ParseStringWithLinksProps> = ({
2121

2222
const processedText = text.split(regex).map((part, index) => {
2323
if (index % 2 === 1) {
24-
const guidMatch = part.match(/([a-f0-9\-]{36})/);
24+
const guidMatch = part.match(/([a-f0-9-]{36})/);
2525
const pageNumberMatch = part.match(/Page\s*(?:Number:)?\s*(\d+)/i);
2626
const chunkNumberMatch = part.match(/Chunk\s*(\d+)/i);
2727

server/balancer_backend/urls.py

Lines changed: 5 additions & 7 deletions
Original file line numberDiff line numberDiff line change
@@ -1,11 +1,13 @@
1-
from django.contrib import admin # Import Django's admin interface module
1+
import os
2+
import importlib
23

4+
from django.conf import settings
5+
from django.contrib import admin # Import Django's admin interface module
6+
from django.http import HttpResponseNotFound
37
# Import functions for URL routing and including other URL configs
48
from django.urls import path, include, re_path
5-
69
# Import TemplateView for rendering templates
710
from django.views.generic import TemplateView
8-
import importlib # Import the importlib module for dynamic module importing
911

1012
# Define a list of URL patterns for the application
1113
# Keep admin outside /api/ prefix
@@ -51,10 +53,6 @@
5153
path("api/", include(api_urlpatterns)),
5254
]
5355

54-
import os
55-
from django.conf import settings
56-
from django.http import HttpResponseNotFound
57-
5856

5957
def spa_fallback(request):
6058
"""Serve index.html for SPA routing when build is present; otherwise 404."""

0 commit comments

Comments
 (0)