Remove a bunch of lints I don't like#147
Merged
Merged
Conversation
Here are some of them:
```
src/ai/types/messages.py:44:5: SIM102 Use a single `if` statement instead of nested `if` statements
|
42 | if _is_file_part_dict(value):
43 | return FilePart.model_validate(value)
44 | if isinstance(value, list):
| _____^
45 | | if any(_is_file_part_dict(item) for item in value):
| |___________________________________________________________^ SIM102
46 | return [
47 | FilePart.model_validate(item)
|
= help: Combine `if` statements using `and`
src/ai/types/messages.py:87:13: PLC2801 Unnecessary dunder call to `__setattr__`. Mutate attribute directly or use setattr built-in function.
|
85 | if rehydrated is not self.result:
86 | # Bypass frozen protection for post-init fixup.
87 | object.__setattr__(self, "result", rehydrated)
| ^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^ PLC2801
88 | return self
|
= help: Mutate attribute directly or use setattr built-in function
tests/providers/ai_gateway/test_protocol.py:452:46: PLC1901 `result["value"][0]["data"] != ""` can be simplified to `result["value"][0]["data"]` as an empty string is falsey
|
450 | assert result["value"][0]["type"] == "image-data"
451 | # Should be base64-encoded
452 | assert result["value"][0]["data"] != ""
| ^^ PLC1901
|
```
I actually might agree with the first one but I don't really want a
linter making that sort of suggestion.
|
The latest updates on your projects. Learn more about Vercel for GitHub.
|
anbuzin
approved these changes
May 21, 2026
elprans
approved these changes
May 22, 2026
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.
Here are some of them:
I actually might agree with the first one but I don't really want a
linter making that sort of suggestion.