File tree Expand file tree Collapse file tree 4 files changed +28
-9
lines changed
Expand file tree Collapse file tree 4 files changed +28
-9
lines changed Original file line number Diff line number Diff line change 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$
Original file line number Diff line number Diff line change @@ -470,6 +470,6 @@ function FeedbackForm({id}: FormProps) {
470470 </ section >
471471 </ >
472472 ) ;
473- } ;
473+ }
474474
475475export default FeedbackForm ;
Original file line number Diff line number Diff 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 - f 0 - 9 \ -] { 36 } ) / ) ;
24+ const guidMatch = part . match ( / ( [ a - f 0 - 9 - ] { 36 } ) / ) ;
2525 const pageNumberMatch = part . match ( / P a g e \s * (?: N u m b e r : ) ? \s * ( \d + ) / i) ;
2626 const chunkNumberMatch = part . match ( / C h u n k \s * ( \d + ) / i) ;
2727
Original file line number Diff line number Diff line change 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
48from django .urls import path , include , re_path
5-
69# Import TemplateView for rendering templates
710from 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
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
5957def spa_fallback (request ):
6058 """Serve index.html for SPA routing when build is present; otherwise 404."""
You can’t perform that action at this time.
0 commit comments