{
"event": "PreToolUse",
"tool_name": "Edit",
"tool_input": {
"file_path": "\/var\/www\/dev.campus.systemische-tools.de\/crawler\/src\/infrastructure\/config\/db_config.py",
"old_string": " if PIPELINE_PATH not in sys.path:\n sys.path.insert(0, PIPELINE_PATH)\n from config import DB_CONFIG # type: ignore[import-not-found]",
"new_string": " if PIPELINE_PATH not in sys.path:\n sys.path.insert(0, PIPELINE_PATH)\n from config import DB_CONFIG # type: ignore[import-not-found] # noqa: PLC0415",
"replace_all": false
}
}
{
"tool_response": {
"filePath": "\/var\/www\/dev.campus.systemische-tools.de\/crawler\/src\/infrastructure\/config\/db_config.py",
"oldString": " if PIPELINE_PATH not in sys.path:\n sys.path.insert(0, PIPELINE_PATH)\n from config import DB_CONFIG # type: ignore[import-not-found]",
"newString": " if PIPELINE_PATH not in sys.path:\n sys.path.insert(0, PIPELINE_PATH)\n from config import DB_CONFIG # type: ignore[import-not-found] # noqa: PLC0415",
"originalFile": "from __future__ import annotations\n\nimport os\nimport sys\nfrom dataclasses import dataclass\nfrom typing import Final\n\nPIPELINE_PATH: Final[str] = \"\/var\/www\/scripts\/pipeline\"\n\n\n@dataclass(frozen=True, slots=True)\nclass DbSettings:\n host: str\n user: str\n password: str\n database: str\n\n\ndef load_db_settings(database: str = \"crawler\") -> DbSettings:\n if PIPELINE_PATH not in sys.path:\n sys.path.insert(0, PIPELINE_PATH)\n from config import DB_CONFIG # type: ignore[import-not-found]\n\n password = DB_CONFIG.get(\"password\") or os.environ.get(\"DB_PASSWORD\", \"\")\n return DbSettings(\n host=DB_CONFIG[\"host\"],\n user=DB_CONFIG[\"user\"],\n password=password,\n database=database,\n )\n",
"structuredPatch": [
{
"oldStart": 19,
"oldLines": 7,
"newStart": 19,
"newLines": 7,
"lines": [
" def load_db_settings(database: str = \"crawler\") -> DbSettings:",
" if PIPELINE_PATH not in sys.path:",
" sys.path.insert(0, PIPELINE_PATH)",
"- from config import DB_CONFIG # type: ignore[import-not-found]",
"+ from config import DB_CONFIG # type: ignore[import-not-found] # noqa: PLC0415",
" ",
" password = DB_CONFIG.get(\"password\") or os.environ.get(\"DB_PASSWORD\", \"\")",
" return DbSettings("
]
}
],
"userModified": false,
"replaceAll": false
}
}