Skip to content
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

Lint config cleanups #28864

Merged
merged 3 commits into from Nov 26, 2019
Merged

Lint config cleanups #28864

merged 3 commits into from Nov 26, 2019

Conversation

@scop
Copy link
Contributor

scop commented Nov 18, 2019

Description:

More lint config cleanups.

Checklist:

  • The code change is tested and works locally.
  • Local tests pass with tox. Your PR cannot be merged unless tests pass
  • There is no commented out code in this PR.
  • I have followed the development checklist

If user exposed functionality or configuration variables are added/changed:

If the code communicates with devices, web services, or third-party tools:

  • The manifest file has all fields filled out correctly. Update and include derived files by running python3 -m script.hassfest.
  • New or updated dependencies have been added to requirements_all.txt by running python3 -m script.gen_requirements_all.
  • Untested files have been added to .coveragerc.

If the code does not interact with devices:

  • Tests have been added to verify that the new code works.
@@ -28,7 +28,7 @@ def session_scope(*, hass=None, session=None):
if session.transaction:
need_rollback = True
session.commit()
except Exception as err: # pylint: disable=broad-except
except Exception as err:

This comment has been minimized.

Copy link
@pvizeli

pvizeli Nov 18, 2019

Member

Why this work? That is a broad exception

This comment has been minimized.

Copy link
@scop

scop Nov 19, 2019

Author Contributor

It is, but pylint doesn't consider it an issue if the same block raises.

@michaelarnauts

This comment has been minimized.

Copy link
Contributor

michaelarnauts commented Nov 19, 2019

Out of curiosity, did you use a command to get the list of ignored rules that didn't have an effect?

@scop

This comment has been minimized.

Copy link
Contributor Author

scop commented Nov 19, 2019

Yep, using pylint itself -- enabling the useless-suppression message reveals them.

@scop

This comment has been minimized.

Copy link
Contributor Author

scop commented Nov 19, 2019

And I did not address all of them, yet. I suspect that the import related ones are dependent on whether pylint is run in a full virtualenv setup or "from the outside", just like our mypy setup is, so didn't touch them at all. IIRC most others are addressed in this and previous PR's though.

It would be nice to be able to turn the informative messages into errors some day. Maybe this one, but at least use-symbolic-message-instead would be a candidate for that. It's not possible yet though, but I have a RFE open about it (and maybe I'll get to hacking that one day, who knows): PyCQA/pylint#3251

@scop scop force-pushed the scop:lint-config-cleanups branch from 024f465 to a83bf83 Nov 19, 2019
@scop

This comment has been minimized.

Copy link
Contributor Author

scop commented Nov 19, 2019

(I don't know how the previous CI/coverage failure could have been related, so rebased+force-pushed to get a re-run.)

@MartinHjelmare MartinHjelmare added this to Needs review in Dev Nov 20, 2019
Dev automation moved this from Needs review to Reviewer approved Nov 26, 2019
@balloob balloob merged commit 99c7608 into home-assistant:dev Nov 26, 2019
11 checks passed
11 checks passed
CI #20191119.25 succeeded
Details
CI (FullCheck Mypy) FullCheck Mypy succeeded
Details
CI (FullCheck Pylint) FullCheck Pylint succeeded
Details
CI (Overview CheckFormat) Overview CheckFormat succeeded
Details
CI (Overview Lint) Overview Lint succeeded
Details
CI (Overview Validate) Overview Validate succeeded
Details
CI (Tests PyTest Python36) Tests PyTest Python36 succeeded
Details
CI (Tests PyTest Python37) Tests PyTest Python37 succeeded
Details
cla-bot Everyone involved has signed the CLA
codecov/patch No report found to compare against
Details
codecov/project 94.47% (target 90%)
Details
Dev automation moved this from Reviewer approved to Done Nov 26, 2019
@scop scop deleted the scop:lint-config-cleanups branch Nov 27, 2019
@lock lock bot locked and limited conversation to collaborators Nov 28, 2019
Sign up for free to subscribe to this conversation on GitHub. Already have an account? Sign in.
You can’t perform that action at this time.