-
Notifications
You must be signed in to change notification settings - Fork 118
New issue
Have a question about this project? Sign up for a free GitHub account to open an issue and contact its maintainers and the community.
By clicking “Sign up for GitHub”, you agree to our terms of service and privacy statement. We’ll occasionally send you account related emails.
Already on GitHub? Sign in to your account
Adding Code Style Checker #118
Conversation
Codecov Report
@@ Coverage Diff @@
## dev #118 +/- ##
==========================================
- Coverage 50.93% 50.82% -0.11%
==========================================
Files 14 14
Lines 1337 1332 -5
Branches 140 140
==========================================
- Hits 681 677 -4
+ Misses 643 642 -1
Partials 13 13
|
I excluded some tests for now (mainly https://travis-ci.org/ikalchev/HAP-python/jobs/376972170#L522-L569 |
Sounds very good. The checks are currently passing because of this, can we exclude the failing checks and enable them gradually? |
What do you think about disabling |
- python: "3.5" | ||
env: TOXENV=lint | ||
# - python: "3.5" | ||
# env: TOXENV=pylint |
There was a problem hiding this comment.
Choose a reason for hiding this comment
The reason will be displayed to describe this comment to others. Learn more.
I disabled the pylint
tests in travis
for now, since they require more attention and should be handled separately.
The test suite can be run with tox -e pylint
. That will exclude missing-docs
.
deps = | ||
-r{toxinidir}/requirements_test.txt | ||
commands = | ||
flake8 pyhap tests --ignore=D10,D205,D4,E501 --exclude=pyhap/accessories/* |
There was a problem hiding this comment.
Choose a reason for hiding this comment
The reason will be displayed to describe this comment to others. Learn more.
The ignores should be removed once the docs pass.
Also the --exclude
flag can be removed with #115.
-r{toxinidir}/requirements_all.txt | ||
-r{toxinidir}/requirements_test.txt | ||
commands = | ||
pylint pyhap --disable=missing-docstring,invalid-name,fixme |
There was a problem hiding this comment.
Choose a reason for hiding this comment
The reason will be displayed to describe this comment to others. Learn more.
Same here for the --disabled
flag.
-r{toxinidir}/requirements_test.txt | ||
commands = | ||
flake8 pyhap tests --select=D10,D205,D4,E501 --exclude=pyhap/accessories/* | ||
pylint pyhap --disable=all --enable=missing-docstring |
There was a problem hiding this comment.
Choose a reason for hiding this comment
The reason will be displayed to describe this comment to others. Learn more.
Run tox -e doc-errors
locally to check which docs needs to be fixed.
@ikalchev This should be ready now if you approve. |
* Merge master back into dev (#111) * Fix typo in log message (#112) * Fix typo in SDS011 * Documentation improvements for version 2.0.0 (#114) * Replace event_loop with loop (#107) * Changelog update (#116) * Added entry for event loop change * Additional changes * Small changes - Accessory (#117) * Improved bridge.to_HAP * Updated changelog * Fix another typo in SDS011 which prevented pm10 from getting updates. * Added getter_callback to Characteristic #78 * Fix typo bridge.to_HAP (#119) * Adding Code Style Checker (#118) * Add basis for style checker * Fixed lint errors * Updated changelog * Improvements 7 - Config class (#120) Added a State class which keeps Accessory runtime properties such as port, address, paired clients, etc. This state is stored and managed by the driver. * Remove the pyhap.accessories package. (#115) * Remove the pyhap.accessories package. All accessories are temporarily moved to the root accessories folder. These will be moved into separate repositories as appropriate. pyhap.accessories is now an implicit namespace package. See pyhap/accessories/README.md for how others can share their accessories as HAP-python subpackages. * Release v2.1.0.
Adding static code style checkers can hugely improve the code quality and catch errors sooner. At the moment these test fail completely, so we might have to decide if we want to add it to travis or leave it out for now. If we move forward with this.