Upgrade pylint to 1.8.2#12274
Conversation
There was a problem hiding this comment.
line too long (80 > 79 characters)
There was a problem hiding this comment.
I believe this should be correct...
There was a problem hiding this comment.
TEMP_CELSIUS is a constant. However appending constants is essentially the same as appending variables in terms of speed (*except for potential compiler optimizations, though the speed impact is negligible)
f3dbd41 to
1d07abf
Compare
|
The latest pylint version is 1.8.2. Any reason not updating to that instead of 1.8.1? |
|
Oh sorry, I wrote 1.8.1 in the description, but I'm running 1.8.2 locally - will update the description. Running with 1.8.1 and 1.8.2 seems to give the same results though. |
|
Fine with for device tracker to rename the official argument to |
Not sure about that TEMP_CELSIUS though, but internally it's probably just like if you concatenated any other (variable) string
Both of these seem to simply be bugs: * Nest: The value of self._humidity never seems to be used anywhere * Dovado: The called API method seems to expect a "normal" number
This reverts commit af78aa00f125a7d34add97b9d50c14db48412211.
* except for device_tracker
I forgot to run flake8 - shame on me... 🙃
|
What about
Additionally, there's another issue that I forgot to mention: Some new checks in pylint 1.8.2, namely |
1d07abf to
e96946d
Compare
|
Are there too many changes needed to also upgrade pylint to 1.8.2 in this PR? |
|
It would work under 1.8.2, but I tried following the advice in this comment |
|
That comment is about Python versions. I don't see anything stopping us from upgrading to pylint 1.8.2 and run that on the Travis pylint tox job. |
903978b to
96d45ac
Compare
Description:
This PR upgrades pylint to 1.8.2 and fixes all resulting error checks.
Related issue (if applicable): #7108
bad-whitespace
PEP8 now recommends whitespace between an argument annotation and a default value around the = sign (see pylint-dev/pylint#238)
The code update however causes pylint 1.6.5 to complain about the version with the whitespace (i.e. the correct version) - so either the commit has to be reverted (and
bad-whitespaceneeds to be disabled for 1.8.2) orbad-whitespaceis disabled for pylint 1.6.5, which could potentially be a bad idea.arguments-differ
Makes sure that the arguments for a overridden method match the super class. Also checks whether the names of the arguments match, which seems a bit verbose to me... Anyway, there's one problem though:
DeviceScanner::get_device_name(self, mac: str) -> strshould, as far as I understand, return the device name given a mac. Many implementations of this however don't use MAC-Addresses and call this argumentdevice, thus triggering the pylint warning. I don't know what to do about this.inconsistent-return-statements
Makes sure all
returnstatements in a function either return something (e.g.None) or nothing. For example:would trigger this check. However, as described in pylint-dev/pylint#1782, this currently doesn't handle
raise- and this erroneous flag is quite common in Home Assistant. Next, I believe correcting this would best be done together with static type checking updates.All Changes
len-as-conditionno-else-returnbad-whitespace(see comment)too-many-nested-blockslogging-not-lazystop-iteration-return(locally disabled due to bug)useless-super-delegationtrailing-comma-tuple(see commit message)redefine-argument-from-localconsider-using-enumerate(see the one case, the length is already checked before, so that works)wrong-import-order(tried to be as consistent as possible)arguments-differ(device_tracker)no-membersignatures-differChecklist:
toxrun successfully. Your PR cannot be merged unless tests pass