Skip to content

Conversation

basnijholt
Copy link
Contributor

@basnijholt basnijholt commented Dec 9, 2019

Description:

🎉 All PRs have been merged!

This adds isort to the CI and pre-commit. I think it is smart to reduce the number of style changes even further, in that way git blame will become even more useful.

isort will enforce a consistent import order, and using the settings I added in the pre-commit config, it plays well with black (source).

I have opened PRs for each component that involves changes to >= 3. I've done this because I think it would be too big of a change too sudden otherwise (as it involves >1000 files which is hard to review).

All changes to components that involve <=2 files, I have partitioned into PRs with the starting letter.

Then per main folder, I have another PR (as discussed with @frenck).

I have opened these PRs:

These are for PRs of components starting with:

And the non-components:

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.

@probot-home-assistant probot-home-assistant bot added the small-pr PRs with less than 30 lines. label Dec 9, 2019
@frenck frenck self-assigned this Dec 9, 2019
@pvizeli
Copy link
Member

pvizeli commented Dec 10, 2019

I think that need a rebase

@basnijholt
Copy link
Contributor Author

@pvizeli #29651 still needs to be merged.

Copy link
Member

@scop scop left a comment

Choose a reason for hiding this comment

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

I fully support this, but the hook config needs to be added to .pre-commit-config-all.yaml too.

@basnijholt
Copy link
Contributor Author

@scop, done!

scop
scop previously requested changes Dec 10, 2019
Copy link
Member

@scop scop left a comment

Choose a reason for hiding this comment

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

pylint also checks order of imports. It uses isort internally so presumably there's at least some compatibility, but it does something more besides just running isort and I'm not sure if it considers our isort config, and with this change those checks are redundant anyway. So I think it would be a good idea to disable wrong-import-order in pylintrc as part of this change. (Maybe doing that might make it a bit faster, or maybe not.)

@basnijholt
Copy link
Contributor Author

basnijholt commented Dec 10, 2019

@scop, good point. I wonder whether we should do that in a new PR after this is merged.

edit: I searched for the occurrences of wrong-import-order but there are none! In that case, it is probably good to just ignore it, yes.

I have added it to pylintrc.

@frenck
Copy link
Member

frenck commented Dec 10, 2019

I just wondered if our auto-generated files actually generate valid imports...

@basnijholt
Copy link
Contributor Author

What files do you mean, specifically?

@frenck frenck dismissed scop’s stale review December 12, 2019 14:57

Comment addressed

@frenck
Copy link
Member

frenck commented Dec 12, 2019

Awesome job @basnijholt! 🥇

@frenck frenck merged commit c58c10a into home-assistant:dev Dec 12, 2019
@basnijholt
Copy link
Contributor Author

You too @frenck, thanks for reviewing the 147 PRs so quickly! 😄

@lock lock bot locked and limited conversation to collaborators Dec 13, 2019
Sign up for free to subscribe to this conversation on GitHub. Already have an account? Sign in.
Labels
cla-signed small-pr PRs with less than 30 lines.
Projects
None yet
Development

Successfully merging this pull request may close these issues.

5 participants