Skip to content

Linter run on top of qualtiy-branch - #30

Merged
CoMPaTech merged 24 commits into
mainfrom
lint_flake2
Oct 31, 2020
Merged

CoMPaTech merged 24 commits into
mainfrom
lint_flake2

Conversation

@CoMPaTech

Copy link
Copy Markdown
Member

Linter had a lot of complaints, squashed most of them, leaving the below. Do not that this is on top of #24!

plugwise/message.py:14:47: E1101: Instance of 'PlugwiseMessage' has no 'args' member (no-member)
plugwise/message.py:15:14: E1101: Instance of 'PlugwiseMessage' has no 'ID' member (no-member)
plugwise/message.py:16:11: E1101: Instance of 'PlugwiseMessage' has no 'mac' member (no-member)
plugwise/message.py:17:19: E1101: Instance of 'PlugwiseMessage' has no 'mac' member (no-member)
plugwise/message.py:22:4: R0201: Method could be a function (no-self-use)
plugwise/node.py:80:4: R0201: Method could be a function (no-self-use)
plugwise/stick.py:1190:25: R1701: Consider merging these isinstance calls to isinstance(self.expected_responses[seq_id][1], (NodeInfoRequest, NodePingRequest)) (consider-merging-isinstance)
plugwise/stick.py:1245:23: R1701: Consider merging these isinstance calls to isinstance(self.expected_responses[seq_id][1], (NodeInfoRequest, NodePingRequest)) (consider-merging-isinstance)
plugwise/stick.py:1422:24: R1701: Consider merging these isinstance calls to isinstance(self._plugwise_nodes[mac], (PlugwiseCircle, PlugwiseCirclePlus, PlugwiseStealth)) (consider-merging-isinstance)
plugwise/stick.py:694:31: R1701: Consider merging these isinstance calls to isinstance(self.expected_responses[seq_id][1], (NodeAddRequest, StickInitRequest)) (consider-merging-isinstance)
plugwise/util.py:161:4: R0201: Method could be a function (no-self-use)

While leaving out all C0121|W0231|C0115|R1702|W0703|C0116|W0707 checks - on a near future run we should also take a look at the (too) broad Exceptions and too-many-nested-blocks

@CoMPaTech CoMPaTech added the enhancement New feature or request label Oct 31, 2020
@CoMPaTech

Copy link
Copy Markdown
Member Author

#24 takes precedence and this one should be rebased after to more clearly depict the changes

Needs thorough testing!

@codecov

codecov Bot commented Oct 31, 2020 •

Copy link
Copy Markdown

Codecov Report

Merging #30 into main will increase coverage by 1.06%.
The diff coverage is 100.00%.

Impacted file tree graph

@@            Coverage Diff             @@
##             main      #30      +/-   ##
==========================================
+ Coverage   93.69%   94.75%   +1.06%     
==========================================
  Files           5        4       -1     
  Lines        1506     1488      -18     
==========================================
- Hits         1411     1410       -1     
+ Misses         95       78      -17     
Impacted Files Coverage Δ
plugwise/exceptions.py 100.00% <ø> (ø)
plugwise/smile.py 91.39% <100.00%> (ø)
tests/test_smile.py 97.60% <100.00%> (-0.01%) ⬇️

Continue to review full report at Codecov.

Legend - Click here to learn more
Δ = absolute <relative> (impact), ø = not affected, ? = missing data
Powered by Codecov. Last update d48252c...fa2a9df. Read the comment docs.

@CoMPaTech
CoMPaTech force-pushed the lint_flake2 branch 2 times, most recently from d4573ee to d896f5e Compare October 31, 2020 10:48
@CoMPaTech

Copy link
Copy Markdown
Member Author

Added defusedxml over lxml for Smiles

@CoMPaTech
CoMPaTech force-pushed the lint_flake2 branch 2 times, most recently from 6960472 to 003d31b Compare October 31, 2020 12:14
Comment thread plugwise/connections/connection.py Resolved
Comment thread plugwise/connections/serial.py Resolved
Comment thread plugwise/connections/socket.py Resolved
Comment thread plugwise/node.py Resolved
Comment thread plugwise/node.py Resolved
Comment thread plugwise/nodes/circle_plus.py Resolved
Comment thread plugwise/nodes/sed.py Resolved
Comment thread plugwise/smile.py Resolved
Comment thread plugwise/smile.py Resolved
Comment thread plugwise/smile.py Resolved
Comment thread tests/test_smile.py Resolved
@CoMPaTech

Copy link
Copy Markdown
Member Author

@bouwew this one should be better readable now #24 is out of the way - some small remarks with our names on it, feel free to close them if in agreement (we should all be able to do that as owners).

@brefra I think most of this is for you to verify/validate. I've commented on most things I changed, so if they are ok just close/resolve the conversations (we should all be able to do that as owners).

In general:

  1. the self.whatever = None in added in the respective __init__s. Per linting it's required all self's have a sane default initialized in init and these didnt.
  2. I renamed some _function_name to function_name again as per lint, since _ should only be available private in a class and not outside the class
  3. Mostly removed from plugwise.message import PlugwiseMessage from all files since it wasn't used - also other CONSTS were removed when not used.

@CoMPaTech
CoMPaTech marked this pull request as ready for review October 31, 2020 15:24
@CoMPaTech
CoMPaTech requested review from bouwew and brefra October 31, 2020 15:26

@bouwew bouwew left a comment •

Copy link
Copy Markdown
Contributor

Choose a reason for hiding this comment

The reason will be displayed to describe this comment to others. Learn more.

All looking good!

Update: the if something is True: and if something is False: occurrences have been fix.

@bouwew bouwew left a comment

Copy link
Copy Markdown
Contributor

Choose a reason for hiding this comment

The reason will be displayed to describe this comment to others. Learn more.

OK!

Comment thread plugwise/messages/responses.py Resolved

@brefra brefra left a comment

Copy link
Copy Markdown
Contributor

Choose a reason for hiding this comment

The reason will be displayed to describe this comment to others. Learn more.

Tested this branch and it works for me 👍

@CoMPaTech
CoMPaTech merged commit de55ec3 into main Oct 31, 2020
@CoMPaTech
CoMPaTech deleted the lint_flake2 branch October 31, 2020 20:43
@brefra brefra mentioned this pull request Oct 31, 2020
Sign up for free to join this conversation on GitHub. Already have an account? Sign in to comment

Labels

enhancement New feature or request

Projects

None yet

Development

Successfully merging this pull request may close these issues.

3 participants