-
Notifications
You must be signed in to change notification settings - Fork 25
Fix TRY003: extract exception messages to variables and remove suppression #208
New issue
Have a question about this project? Sign up for a free GitHub account to open an issue and contact its maintainers and the community.
By clicking “Sign up for GitHub”, you agree to our terms of service and privacy statement. We’ll occasionally send you account related emails.
Already on GitHub? Sign in to your account
base: main
Are you sure you want to change the base?
Changes from all commits
File filter
Filter by extension
Conversations
Jump to
Diff view
Diff view
There are no files selected for viewing
| Original file line number | Diff line number | Diff line change | ||||
|---|---|---|---|---|---|---|
|
|
@@ -167,7 +167,8 @@ def get_AI_token() -> str: | |||||
| token = os.getenv("COPILOT_TOKEN") | ||||||
| if token: | ||||||
| return token | ||||||
| raise RuntimeError("AI_API_TOKEN environment variable is not set.") | ||||||
| msg = "AI_API_TOKEN environment variable is not set." | ||||||
|
||||||
| msg = "AI_API_TOKEN environment variable is not set." | |
| msg = "Neither AI_API_TOKEN nor COPILOT_TOKEN environment variable is set." |
| Original file line number | Diff line number | Diff line change | ||||
|---|---|---|---|---|---|---|
|
|
@@ -194,10 +194,12 @@ def _server_request_run( | |||||
| template_values: dict | None = None, | ||||||
| ): | ||||||
| if not self.active_database: | ||||||
| raise RuntimeError("No Active Database") | ||||||
| msg = "No Active Database" | ||||||
| raise RuntimeError(msg) | ||||||
|
|
||||||
| if not self.active_connection: | ||||||
| raise RuntimeError("No Active Connection") | ||||||
| msg = "No Active Connection" | ||||||
| raise RuntimeError(msg) | ||||||
|
|
||||||
| if isinstance(quick_eval_pos, dict): | ||||||
| # A quick eval position contains: | ||||||
|
|
@@ -302,7 +304,8 @@ def _format(self, query): | |||||
| def _resolve_query_server(self): | ||||||
| help_msg = shell_command_to_string(self.codeql_cli + ["excute", "--help"]) | ||||||
|
||||||
| help_msg = shell_command_to_string(self.codeql_cli + ["excute", "--help"]) | |
| help_msg = shell_command_to_string(self.codeql_cli + ["execute", "--help"]) |
There was a problem hiding this comment.
Choose a reason for hiding this comment
The reason will be displayed to describe this comment to others. Learn more.
This per-file ignore for
jsonrpyc/*is likely redundant because the directory is already excluded via[tool.ruff].extend-exclude(src/seclab_taskflow_agent/mcp_servers/codeql/jsonrpyc/). Either remove this per-file ignore, or (if you want Ruff to lint these files for other rules) drop theextend-excludeand keep a targeted per-file ignore.