Fix the lint on osint-hub #97

Closed
opened 2026-08-12 03:49:05 +00:00 by Mark · 1 comment
Owner

Pre-flight lint check for Mark/osint-hub failed. Kilo-GSD is hard-gated on clean lint and refuses to start work on this repo until the debt is resolved.

What is dirty

PLC0415 `import` should be at the top-level of a file
  --> backend/app/change_detector.py:75:9
   |
73 |     @staticmethod
74 |     def detect_json_changes(old_data: dict | None, new_data: dict) -> ChangeDetectionResult:
75 |         import json
   |         ^^^^^^^^^^^
76 |
77 |         old_str = json.dumps(old_data, sort_keys=True, indent=2) if old_data else ""
   |

PLC0415 `import` should be at the top-level of a file
  --> backend/app/main.py:48:9
   |
46 |             mapper.configured = True
47 |     except Exception as e:
48 |         import logging
   |         ^^^^^^^^^^^^^^
49 |
50 |         logging.getLogger(__name__).warning(f"Failed to configure mappers: {e}")
   |

PLC0415 `import` should be at the top-level of a file
  --> backend/app/main.py:97:5
   |
95 |         return await call_next(request)
96 |
97 |     import time
   |     ^^^^^^^^^^^
98 |
99 |     start = time.time()
   |

PLC0415 `import` should be at the top-level of a file
  --> backend/app/modules/abuseipdb.py:25:9
   |
23 |             - max_age_days: int - Max age of reports (default: 30)
24 |         """
25 |         from ..settings import settings
   |         ^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^
26 |
27 |         api_key = options.get("api_key") or getattr(settings, "abuseipdb_api_key", None)
   |

PLC0415 `import` should be at the top-level of a file
   --> backend/app/modules/dark_web_monitor.py:103:13
    |
101 |         """Fetch content from .onion site"""
102 |         try:
103 |            

Why this issue exists

Kilo-GSD was attempting Mark/osint-hub#96 but the preflight ruff check . returned 1. We do not knowingly pass along lint errors; the original ticket is held until this one is resolved and the lint is clean.

Scope

Fix every lint error reported above so ruff check . exits 0 against Mark/osint-hub. Do not change behavior — only fix style/dead-code/safety issues that lint flags. Commit on a branch and open a PR. Once merged, kilo-gsd will resume the held tickets.

Pre-flight lint check for `Mark/osint-hub` failed. Kilo-GSD is hard-gated on clean lint and refuses to start work on this repo until the debt is resolved. ## What is dirty ``` PLC0415 `import` should be at the top-level of a file --> backend/app/change_detector.py:75:9 | 73 | @staticmethod 74 | def detect_json_changes(old_data: dict | None, new_data: dict) -> ChangeDetectionResult: 75 | import json | ^^^^^^^^^^^ 76 | 77 | old_str = json.dumps(old_data, sort_keys=True, indent=2) if old_data else "" | PLC0415 `import` should be at the top-level of a file --> backend/app/main.py:48:9 | 46 | mapper.configured = True 47 | except Exception as e: 48 | import logging | ^^^^^^^^^^^^^^ 49 | 50 | logging.getLogger(__name__).warning(f"Failed to configure mappers: {e}") | PLC0415 `import` should be at the top-level of a file --> backend/app/main.py:97:5 | 95 | return await call_next(request) 96 | 97 | import time | ^^^^^^^^^^^ 98 | 99 | start = time.time() | PLC0415 `import` should be at the top-level of a file --> backend/app/modules/abuseipdb.py:25:9 | 23 | - max_age_days: int - Max age of reports (default: 30) 24 | """ 25 | from ..settings import settings | ^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^ 26 | 27 | api_key = options.get("api_key") or getattr(settings, "abuseipdb_api_key", None) | PLC0415 `import` should be at the top-level of a file --> backend/app/modules/dark_web_monitor.py:103:13 | 101 | """Fetch content from .onion site""" 102 | try: 103 | ``` ## Why this issue exists Kilo-GSD was attempting `Mark/osint-hub#96` but the preflight `ruff check .` returned 1. We do not knowingly pass along lint errors; the original ticket is held until this one is resolved and the lint is clean. ## Scope Fix every lint error reported above so `ruff check .` exits 0 against `Mark/osint-hub`. Do not change behavior — only fix style/dead-code/safety issues that lint flags. Commit on a branch and open a PR. Once merged, kilo-gsd will resume the held tickets.
Author
Owner

PR opened: #98 (fix/lint-plc0415 -> main)

Full-repo ruff cleanup: ruff check . now exits 0 (was 219 errors across 50 files). kilo-gsd preflight can resume held tickets #96/#95 once merged.

Verification: ruff check . / backend/ / backend/app/ all pass; 945 unit tests pass; no import cycles.

PR opened: https://forgejo.tail018ac4.ts.net/Mark/osint-hub/pulls/98 (fix/lint-plc0415 -> main) Full-repo ruff cleanup: `ruff check .` now exits 0 (was 219 errors across 50 files). kilo-gsd preflight can resume held tickets #96/#95 once merged. Verification: ruff check . / backend/ / backend/app/ all pass; 945 unit tests pass; no import cycles.
Mark closed this issue 2026-09-05 18:46:54 +00:00
Sign in to join this conversation.
No milestone
No project
No assignees
1 participant
Notifications
Due date
The due date is invalid or out of range. Please use the format "yyyy-mm-dd".

No due date set.

Dependencies

No dependencies set.

Reference
Mark/osint-hub#97
No description provided.