Enforce EM102 by fixing exception formatting and removing ignore#257
Open
Copilot wants to merge 2 commits into
Open
Enforce EM102 by fixing exception formatting and removing ignore#257Copilot wants to merge 2 commits into
Copilot wants to merge 2 commits into
Conversation
Open
Copilot
AI
changed the title
[WIP] Fix linter error EM102 and remove from suppression list
Enforce EM102 by fixing exception formatting and removing ignore
Jun 1, 2026
p-
approved these changes
Jun 1, 2026
Contributor
There was a problem hiding this comment.
Pull request overview
This PR aims to start enforcing Ruff rule EM102 (no f-strings directly inside exception constructors) by updating one offending ValueError(...) site and removing EM102 from Ruff’s global ignore list so future code must comply.
Changes:
- Refactors
TaskflowHeader._validate_version()to avoid raising an exception with an inline f-string. - Updates
pyproject.tomlto removeEM102from[tool.ruff.lint].ignore.
Show a summary per file
| File | Description |
|---|---|
src/seclab_taskflow_agent/models.py |
Refactors exception message construction to comply with EM102. |
pyproject.toml |
Removes EM102 from the global Ruff ignore list to enforce the rule. |
Copilot's findings
Tip
Add Copilot custom instructions for smarter, more guided reviews. Learn how to get started.
- Files reviewed: 2/2 changed files
- Comments generated: 1
Comment on lines
183
to
187
| # Style choices — deliberate project conventions | ||
| "EM101", # Exception string literals | ||
| "EM102", # Exception f-strings | ||
| "G004", # Logging f-strings | ||
| "T201", # print() used for user output | ||
| "TRY003", # Raise with inline message strings |
This file contains hidden or bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
Sign up for free
to join this conversation on GitHub.
Already have an account?
Sign in to comment
Add this suggestion to a batch that can be applied as a single commit.This suggestion is invalid because no changes were made to the code.Suggestions cannot be applied while the pull request is closed.Suggestions cannot be applied while viewing a subset of changes.Only one suggestion per line can be applied in a batch.Add this suggestion to a batch that can be applied as a single commit.Applying suggestions on deleted lines is not supported.You must change the existing code in this line in order to create a valid suggestion.Outdated suggestions cannot be applied.This suggestion has been applied or marked resolved.Suggestions cannot be applied from pending reviews.Suggestions cannot be applied on multi-line comments.Suggestions cannot be applied while the pull request is queued to merge.Suggestion cannot be applied right now. Please check back later.
This PR addresses EM102 by eliminating an exception f-string in production code and removing EM102 from Ruff’s global ignore list so the rule is enforced going forward.
Scope of change
TaskflowHeaderversion validation (src/seclab_taskflow_agent/models.py)raise ValueError(...)with a pre-assigned message variable to comply with EM102.pyproject.toml)EM102from[tool.ruff.lint].ignorebaseline suppressions.Code example