Skip to content
Merged
Changes from all commits
Commits
File filter

Filter by extension

Filter by extension

Conversations
Failed to load comments.
Loading
Jump to
Jump to file
Failed to load files.
Loading
Diff view
Diff view
4 changes: 4 additions & 0 deletions elementary/utils/pydantic_shim.py
Original file line number Diff line number Diff line change
Expand Up @@ -11,17 +11,21 @@
if pydantic_major == "1":
from pydantic import ( # type: ignore # noqa
BaseModel,
EmailStr,
Extra,
Field,
ValidationError,
create_model,
root_validator,
validator,
)
elif pydantic_major == "2":
from pydantic.v1 import ( # type: ignore # noqa
Copy link
Copy Markdown

Choose a reason for hiding this comment

The reason will be displayed to describe this comment to others. Learn more.

⚠️ Potential issue | 🟡 Minor

Remove unused blanket # noqa (RUF100).

Ruff reports the # noqa is unused; drop it or replace with a specific code if needed.

Proposed fix
-from pydantic.v1 import (  # type: ignore  # noqa
+from pydantic.v1 import (  # type: ignore
📝 Committable suggestion

‼️ IMPORTANT
Carefully review the code before committing. Ensure that it accurately replaces the highlighted code, contains no missing lines, and has no issues with indentation. Thoroughly test & benchmark the code to ensure it meets the requirements.

Suggested change
from pydantic.v1 import ( # type: ignore # noqa
from pydantic.v1 import ( # type: ignore
🧰 Tools
🪛 Ruff (0.15.0)

[warning] 23-23: Unused blanket noqa directive

Remove unused noqa directive

(RUF100)

🤖 Prompt for AI Agents
In `@elementary/utils/pydantic_shim.py` at line 23, Remove the unused blanket "#
noqa" on the pydantic v1 import in pydantic_shim.py (the line starting with
"from pydantic.v1 import"); either drop the "# noqa" entirely or replace it with
a specific Ruff code (e.g., "# noqa: F401" if the import is intentionally
unused) so the linter no longer reports RUF100.

BaseModel,
EmailStr,
Extra,
Field,
ValidationError,
create_model,
root_validator,
validator,
Expand Down
Loading