Remove E402, node ARG001, and straggler noqas (PR 2 of 3)#1576
Conversation
Greptile code reviewThis repo uses Greptile for automated review. Before merge, aim for Confidence Score: 5/5 with zero unresolved review threads — see CONTRIBUTING.md. Run a review — add a PR comment with: Give it ~30–60 seconds (sometimes longer) for results, then fix feedback and re-trigger until you reach Confidence Score: 5/5. Optional: automate with the greploop skill. |
Greptile SummaryThis PR removes 9
Confidence Score: 5/5Safe to merge — all changes are lint cleanup with no logic modifications. Every changed file is a targeted noqa removal paired with the minimal code fix that satisfies the linter: deferred imports in main.py, del statements in node wrappers, and dead-comment deletions elsewhere. None of the changes alter runtime behavior, and the node signatures still satisfy LangGraph's keyword-argument injection contract. No files require special attention. Important Files Changed
Flowchart%%{init: {'theme': 'neutral'}}%%
flowchart TD
A["python -m app.main / CLI entrypoint"] --> B["import app.main\n(only dotenv imported at module level)"]
B --> C["main() called"]
C --> D["load_dotenv(override=False)\n— env vars populated"]
D --> E["Lazy imports executed\n(app.cli, app.utils.sentry_sdk, etc.)"]
E --> F["init_sentry()"]
F --> G["parse_args → run_investigation_cli"]
subgraph "LangGraph Node Calls"
H["LangGraph passes config=RunnableConfig\nas keyword arg"]
H --> I["node_xxx(state, config=...)"]
I --> J["del config -- marks unused, satisfies ARG001"]
J --> K["node body executes with state only"]
end
Reviews (1): Last reviewed commit: "Remove ARG001/PLC0415/BLE001 noqas in no..." | Re-trigger Greptile |
|
🧑💻 @AniketR10 has entered the contributor hall of fame. Merged. Done. Shipped. Go touch grass (then come back with another PR). 🌱 👋 Join us on Discord - OpenSRE : hang out, contribute, or hunt for features and issues. Everyone's welcome. |
Pulls in Tracer-Cloud#1576 (E402/ARG001 noqa cleanup) and Tracer-Cloud#1579 (asyncio/selector failure handling). Conflict resolved in app/main.py: kept upstream's refactor that defers load_dotenv + module imports into main() to drop the E402 noqas, and reapplied this branch's `init_sentry(entrypoint= "cli")` on top.
…ud#1576) * Move app imports inside main() to remove E402 noqas (PR #2 of 4) * Remove ARG001/PLC0415/BLE001 noqas in nodes and stragglers (PR Tracer-Cloud#3 of 4) * fix: add comment on banner.py to satisfy codeQL flagging

Fixes #1401
Describe the changes you have made in this PR -
PR 2 of 3 - removes 9 noqas through small, targeted refactors.
app/main.py - moved app imports inside main() so load_dotenv() can stay above them without E402 suppressions (5 noqas).
app/nodes/ - added del config to the 5 LangGraph node functions whose config arg is required by the framework wrapper but unused in the body (5 ARG001 noqas).
Stragglers added by other PRs since the audit:
3 dead noqas in banner.py and errors.py — auto-removed via RUF100.
1 real ARG002 in test_llm_client.py— used del (mock matches Anthropic SDK's keyword-arg signature).
Code Understanding and AI Usage
Did you use AI assistance (ChatGPT, Claude, Copilot, etc.) to write any part of this code?
If you used AI assistance:
Explain your implementation approach:
The repo had a bunch of # noqa lint suppressions across app/main.py, the LangGraph node files, and a few tests. I removed each one by fixing the underlying cause rather than relocating the suppression: in main.py I moved the app imports inside main() so they no longer need an E402 exception, and for the node functions and a test mock — where renaming unused args to _ would break frameworks that match by keyword name — I kept the original parameter and added del at the top of the body. A few stragglers added by other PRs were just dead suppressions pointing at rules the project doesn't enforce, so I deleted them. Net result: 9 fewer noqas, all lint and tests still green, no behavior change.
Checklist before requesting a review
Note: Please check Allow edits from maintainers if you would like us to assist in the PR.