Adds .gitea/workflows/lint.yml running flake8 with .flake8 config. Removes unused imports (flask.redirect, flask.url_for, time, typing.Tuple). Config ignores E221/E305 (intentional column alignment and function spacing). Co-Authored-By: Claude Sonnet 4.6 <noreply@anthropic.com>
This commit is contained in:
@@ -0,0 +1,6 @@
|
||||
[flake8]
|
||||
max-line-length = 120
|
||||
# E221: multiple spaces before operator — intentional column alignment
|
||||
# E305: two blank lines after function — relaxed for module-level code
|
||||
extend-ignore = E221, E305
|
||||
exclude = __pycache__, .git
|
||||
@@ -0,0 +1,20 @@
|
||||
name: Lint
|
||||
|
||||
on:
|
||||
push:
|
||||
branches: ["**"]
|
||||
pull_request:
|
||||
branches: ["**"]
|
||||
|
||||
jobs:
|
||||
python-lint:
|
||||
name: Python (flake8)
|
||||
runs-on: ubuntu-latest
|
||||
steps:
|
||||
- uses: actions/checkout@v3
|
||||
|
||||
- name: Install flake8
|
||||
run: pip install flake8
|
||||
|
||||
- name: Run flake8
|
||||
run: flake8 .
|
||||
@@ -13,7 +13,7 @@ import time
|
||||
import uuid
|
||||
from functools import wraps
|
||||
|
||||
from flask import Flask, jsonify, redirect, render_template, request, url_for
|
||||
from flask import Flask, jsonify, render_template, request
|
||||
|
||||
import db
|
||||
import diagnose
|
||||
@@ -42,6 +42,7 @@ def inject_config():
|
||||
}
|
||||
}
|
||||
|
||||
|
||||
# In-memory diagnostic job store { job_id: { status, result, created_at } }
|
||||
_diag_jobs: dict = {}
|
||||
_diag_lock = threading.Lock()
|
||||
|
||||
+1
-2
@@ -6,9 +6,8 @@ Executed in a background thread; results stored in _diag_jobs (app.py).
|
||||
"""
|
||||
import re
|
||||
import shlex
|
||||
import time
|
||||
import logging
|
||||
from typing import Dict, List, Optional, Tuple
|
||||
from typing import Dict, List, Optional
|
||||
|
||||
logger = logging.getLogger('gandalf.diagnose')
|
||||
|
||||
|
||||
Reference in New Issue
Block a user