-
Notifications
You must be signed in to change notification settings - Fork 44
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
Implement type checking with github actions #775
Comments
I used |
If these can't be solved and we want to implement type checking in CI, we need to flag each of them with |
No, I agree, but I think these errors can be solved. I'm just not comfortable making adjustments to the base module logic without a second opinion from someone with more intimate knowledge of the codebase. We could make a list of all unique errors in the annotated modules, and make a PR to solve them. |
@roberto-arista Yes, keep to the v1 branch, and yes have |
Remaining errors to be collected in robotools#775: ```zsh contour.py:58: error: Signature of "_reprContents" incompatible with supertype "BaseObject" [override] contour.py:58: note: Superclass: contour.py:58: note: @classmethod contour.py:58: note: def _reprContents(cls) -> List[str] contour.py:58: note: Subclass: contour.py:58: note: def _reprContents(self) -> List[str] contour.py:125: error: Incompatible types in assignment (expression has type "Callable[[], Any]", variable has type "Optional[BaseGlyph]") [assignment] contour.py:125: error: Argument 1 to "reference" has incompatible type "BaseGlyph"; expected "Callable[[], Any]" [arg-type] contour.py:277: error: "BaseContour" has no attribute "_getIdentifierforPoint"; maybe "_getIdentifierForPoint" or "getIdentifierForPoint"? [attr-defined] contour.py:477: error: Signature of "isCompatible" incompatible with supertype "InterpolationMixin" [override] contour.py:477: note: Superclass: contour.py:477: note: def isCompatible(self, other: Any, cls: Type[Any]) -> Tuple[bool, Any] contour.py:477: note: Subclass: contour.py:477: note: def isCompatible(self, other: BaseContour) -> Tuple[bool, str] contour.py:532: error: "str" has no attribute "fatal" [attr-defined] contour.py:532: error: "str" has no attribute "warning" [attr-defined] contour.py:533: error: "str" has no attribute "fatal" [attr-defined] contour.py:535: error: "str" has no attribute "warning" [attr-defined] contour.py:657: error: "BaseContour" has no attribute "_reverseContour" [attr-defined] ```
These
@roberto-arista @benkiel This is what I have so far. Any suggestions on how to fix these, preferably without the use of |
Hey @knutnergaard!
To be honest, I don't know the code base well enough to provide a solution for any of these issues, sorry. |
@roberto-arista Yes, that's correct. Though I see no reason why it should be a classmethod in the |
For 4: yes, should be |
Error 4 resolved in #794 |
@benkiel Regarding error 1: Can the base method be changed to an instance method without breaking anything? Regarding error 2: can the Those are the most straightforward ways to solve those issues. |
@knutnergaard I think the answer to 1 is yes. Need to poke more to understand 2 |
@benkiel 5 can probably be solved by creating abstract members for what's missing. This would require all affected classes to inherit from Are you ok with adding this? Edit 1: I should add that even thought this involves some duplication, it will make it much easier to keep track of which methods are created where, especially with sufficient documentation. |
@benkiel I've added abstract members to |
@knutnergaard I am ok with this, looking at the code. PR away and let me know what from the above then still needs answers. |
@benkiel 5 solved in #803. Presuming it's ok to fix 1 based on your answer, this leaves 2, 3, 6 and 7. |
Yes, fine to fix 1 that way. |
1 and 2 solved in #807. |
Seems 7 was indirectly solved in #803. That leaves 3 and 6. |
I think 3 and 6 are related. |
@benkiel I think they might be too. The way to go might be a simple |
@benkiel @roberto-arista So, I solved the last two in #808. There is still a single error in |
The |
Pulled! |
👏 |
@roberto-arista @benkiel #809 and #810 takes care of the errors thrown outside of |
Hey @benkiel and @knutnergaard,
I took a quick look into this and have a couple of questions:
tox
?mypy
orpyright
when updating the code? I ran a quick scan of the v1 codebase with mypy error highlighting and noticed several issues.Looking forward to your input! 👋
The text was updated successfully, but these errors were encountered: