PyCharm provides some helpful warnings on code style, conventions and logical gotchas. It also provides a notification if I try to commit code with warnings (or errors).
Sometimes I consciously ignore these warnings for particular lines of code (for various reasons, typically to account for implementation details of third-party libraries). I want to suppress the warning, but just for that line (if the warning crops up on a different line where I'm not being deliberate, I want to know about it!)
How can I do that in PyCharm? (Following a universal Python convention strongly preferable.)
@SuppressWarnings
annotation, to indicate 'yeah, this line of code looks bad, but it's okay, I promise'. stackoverflow.com/a/14463362/1450294 ← This answer looked hopeful, but I still couldn't get the 'Too broad exception clause' warnings to go away when I'm logging the exceptions. – Michael Scheperpylint
suppression. As long as all of you usepylint
you should get what you expect. – sophrospylint
to ignore particular warnings for particular lines of code, within the code? – Michael Scheperpylint
explicitly. This is all depicted in the answer to the question about both. – sophros