Skip to content
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

misc: miscellaneous linting wrt Pylance #3262

Merged
merged 7 commits into from
Oct 9, 2024
Merged

Conversation

superlopuh
Copy link
Member

Another small step towards updating Pyright, contains small changes that both our current Pyright and the new one are happy with. Pylance errors: 109 -> 94

@superlopuh superlopuh added the misc Miscellaneous label Oct 8, 2024
@superlopuh superlopuh self-assigned this Oct 8, 2024
Comment on lines +243 to +245
type(cls), # pyright: ignore[reportUnknownArgumentType]
cls.__name__,
(cls,), # pyright: ignore[reportUnknownArgumentType]
Copy link
Member Author

Choose a reason for hiding this comment

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

these ignores are only needed for our pyright, the new one is happy with this, I'll do a pass to remove them with the automated "unnecessary ignores as errors" option

Comment on lines -696 to -703
def verify(self) -> None:
for idx, val in enumerate(self.data):
if not isinstance(val, Attribute):
raise VerifyException(
f"{self.name} data expects attribute list, but element "
f"{idx} is of type {type(val)}."
)

Copy link
Member Author

Choose a reason for hiding this comment

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

The type system already enforces this, surely we don't need to check this again? Pylance now complains

Copy link

codecov bot commented Oct 8, 2024

Codecov Report

All modified and coverable lines are covered by tests ✅

Project coverage is 89.93%. Comparing base (bc49e84) to head (eca7174).
Report is 2 commits behind head on main.

Additional details and impacted files
@@            Coverage Diff             @@
##             main    #3262      +/-   ##
==========================================
+ Coverage   89.92%   89.93%   +0.01%     
==========================================
  Files         442      442              
  Lines       55490    55480      -10     
  Branches     8656     8651       -5     
==========================================
- Hits        49899    49897       -2     
+ Misses       4161     4157       -4     
+ Partials     1430     1426       -4     

☔ View full report in Codecov by Sentry.
📢 Have feedback on the report? Share it here.

Copy link
Collaborator

@math-fehr math-fehr left a comment

Choose a reason for hiding this comment

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

🚀

@superlopuh superlopuh merged commit 11ed2c2 into main Oct 9, 2024
14 checks passed
@superlopuh superlopuh deleted the sasha/misc/lint-more branch October 9, 2024 10:22
Sign up for free to join this conversation on GitHub. Already have an account? Sign in to comment
Labels
misc Miscellaneous
Projects
None yet
Development

Successfully merging this pull request may close these issues.

3 participants