Upgrade pylint to 2.2.2#18750
Upgrade pylint to 2.2.2#18750balloob merged 7 commits intohome-assistant:devfrom scop:upgrade-pylint
Conversation
|
|
||
| def setup_message(self): | ||
| """Prevent print of pyhap setup message to terminal.""" | ||
| pass |
There was a problem hiding this comment.
IMO we should leave pass as it is. It might not be necessary, but it certainly improves readability.
There was a problem hiding this comment.
I agree. Seeing bare lines after a : gives me the willies.
There was a problem hiding this comment.
FWIW I do not agree. But anyway I don't think there's a clean way to omit just these particular unnecessary passes, it would have to be done to all of them. And I think doing that would probably make things worse also in eyes of some people who would like to keep just the unnecessary passes that would have been removed in this PR. I certainly think that would make things worse overall. So I'm afraid we're a bit stuck with the upgrade here, then.
There was a problem hiding this comment.
You can still look at upgrading – just disable unnecessary-pass in pylintrc.
There was a problem hiding this comment.
I think that just disabling unnecessary-pass is fine. We might get some extra pass in places it really shouldn't be, but I think that's fine.
There was a problem hiding this comment.
Pylint has a lot of opinionate cleanup-like options, it does much more than helps catch common mistakes. Many (most?) of those are enabled for HA, even though what they do have only cosmetic/aesthetic value. Opinions vary whether those are liked or are a good thing, and we've now hit one here where they vary.
As said, I don't personally think that a global unnecessary-pass disable would be a good thing to do, so it wouldn't make sense for me to do that. Others seem to have different opinions on the matter, so I suggest someone first does that along with their reasoning in pylintrc in a separate PR, and afterwards I'll rebase this PR, keeping only the uncontroversial changes. Will take a look at upgrading to 2.2.2 meanwhile.
There was a problem hiding this comment.
I wish PyLint was a bit more configurable. A config option for unnecessary-pass to not count doc strings as statements when determining if a pass is needed would have helped here.
There was a problem hiding this comment.
Yeah, but then again I don't think there's much to blame them for here -- these passes are unnecessary after all, people are just accustomed to seeing them. I found their flagging and looks after removal somewhat odd at first sight too, but after thinking about it for a bit, this is consistent and justifiable so I've tweaked my personal preference instead.
Description:
Upgrade to pylint 2.2.1, address new flagged issues.
http://pylint.pycqa.org/en/latest/whatsnew/changelog.html#what-s-new-in-pylint-2-2
Checklist:
tox. Your PR cannot be merged unless tests pass