on-internet
← Community

Rule exceptions for specific libraries

Stack Overflow ·

I am applying Pyright to my project. I want to fix issues however, on specific imports I want to ignore some rules. File or line level rule exceptions are problematic for me. Line level: from mockito import ANY, mock, unstub, when ... when(bob).get_fruit("Apple").thenReturn("Apple") # pyright: ignore[reportUnknownMemberType] I can keep the rule exception on specific situations but I need to repeat that for each line. File level: # pyright: reportUnknownMemberType=false from mockito import ANY, mock, unstub, when ... when(bob).get_fruit("Apple").thenReturn("Apple") Now I don't need to repeat bu

Comments

Sign in or sign up to comment and upvote.

No comments yet.