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

Clean up imports #1084

Merged
merged 1 commit into from
Feb 22, 2020
Merged

Clean up imports #1084

merged 1 commit into from
Feb 22, 2020

Conversation

tburrows13
Copy link
Collaborator

@tburrows13 tburrows13 commented Feb 22, 2020

I've gone through the entire repo with isort. I've clicked through each one, and they are all just reordering the imports. The only exception is editor.py which is rather unique, with lots of ifs and trys in order to import everything, so I've left it as it is.

@coveralls
Copy link

coveralls commented Feb 22, 2020

Coverage Status

Coverage remained the same at 64.961% when pulling 9f3403c on tburrows13:isort-imports into 214e22d on Zulko:master.

@tburrows13 tburrows13 merged commit 1c368a1 into Zulko:master Feb 22, 2020
@tburrows13 tburrows13 added the refactor Does not affect the end user at all i.e. making code easier to read or PEP8 compliant. label Feb 24, 2020
@tburrows13 tburrows13 deleted the isort-imports branch April 26, 2020 22:51
@mondeja
Copy link
Collaborator

mondeja commented Jan 19, 2021

We can set up isort checking as part of CI so we don't need to make this cleanup periodically. Do you agree @tburrows13?

@tburrows13
Copy link
Collaborator Author

I'm not too bothered. It is just another thing that people would have to run before committing, and I don't think it really matters that much. Someone doing it 'manually' every few months/years like I've done is probably sufficient, but I don't mind if you want to add it to the CI.

@tburrows13
Copy link
Collaborator Author

Also there's a possible chance that it conflicts with black, so ensure that's not the case before going any further!

@mondeja
Copy link
Collaborator

mondeja commented Jan 19, 2021

I'm not too bothered. It is just another thing that people would have to run before committing, and I don't think it really matters that much.

You are right, three commands are too much, but this could be fixed easily with pre-commit and adding a dev optional requirements group. Inside that group would be all other dependencies (test, lint, optional, pre-commit, isort...). If we explain how to install (pretty simple, just pre-commit install after install dependencies with pip install -e .[dev]) wouldn't be needed execute anything before commits, the CI will be executed locally formatting files in place and raising flake8 errors blocking the commit if found.

Also there's a possible chance that it conflicts with black, so ensure that's not the case before going any further!

Don't worry, it's just a bit of configuration, I've done it before 👍

So, what do you say, pre-commit + isort and to forget executing the linting process before commits?

Sign up for free to join this conversation on GitHub. Already have an account? Sign in to comment
Labels
refactor Does not affect the end user at all i.e. making code easier to read or PEP8 compliant.
Projects
None yet
Development

Successfully merging this pull request may close these issues.

3 participants