fix(scrapers): remove unused import and fix E402 in base.py
Problem: `atcoder.py` imported `pathlib.Path` but never used it. `base.py` had local imports placed after module-level code, violating E402. Solution: Remove the unused `Path` import from `atcoder.py`. Move the `.language_ids` and `.models` imports to the top of `base.py`, after the stdlib imports.
This commit is contained in:
parent
11ce743273
commit
74c46526c2
2 changed files with 41 additions and 20 deletions
|
|
@ -7,6 +7,16 @@ from abc import ABC, abstractmethod
|
|||
from pathlib import Path
|
||||
from typing import Any
|
||||
|
||||
from .language_ids import get_language_id
|
||||
from .models import (
|
||||
CombinedTest,
|
||||
ContestListResult,
|
||||
LoginResult,
|
||||
MetadataResult,
|
||||
SubmitResult,
|
||||
TestsResult,
|
||||
)
|
||||
|
||||
_COOKIE_FILE = Path.home() / ".cache" / "cp-nvim" / "cookies.json"
|
||||
|
||||
|
||||
|
|
@ -36,17 +46,6 @@ def clear_platform_cookies(platform: str) -> None:
|
|||
except Exception:
|
||||
pass
|
||||
|
||||
|
||||
from .language_ids import get_language_id
|
||||
from .models import (
|
||||
CombinedTest,
|
||||
ContestListResult,
|
||||
LoginResult,
|
||||
MetadataResult,
|
||||
SubmitResult,
|
||||
TestsResult,
|
||||
)
|
||||
|
||||
_PRECISION_ABS_REL_RE = re.compile(
|
||||
r"(?:absolute|relative)\s+error[^.]*?10\s*[\^{]\s*\{?\s*[-\u2212]\s*(\d+)\s*\}?",
|
||||
re.IGNORECASE,
|
||||
|
|
|
|||
Loading…
Add table
Add a link
Reference in a new issue