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

Set up isort #1947

Merged
merged 4 commits into from Jul 7, 2021
Merged

Set up isort #1947

merged 4 commits into from Jul 7, 2021

Conversation

dopplershift
Copy link
Member

@dopplershift dopplershift commented Jul 2, 2021

Description Of Changes

This sets up isort to match our current import style as closely as possible. Other than removing some blank lines (which still passes flake8), it's mostly just compressing some imports a little better. I've gone ahead and remove flake8-import-order from our plugin suite and replaced with flake8-isort. While the latter gives less useful output, it makes use of our isort config--and we can pretty much just ignore any output issues by running isort. This is easily set up with pre-commit, though the question of whether to use pre-commit in CI (or use https://pre-commit.ci) is still an open one.

We can adjust change this isort config to something like profile='black' if we ever decide to go in that direction. Alternative to #1530.

Checklist

@dopplershift dopplershift added Area: Infrastructure Pertains to project infrastructure (e.g. CI, linting) Type: Enhancement Enhancement to existing functionality labels Jul 2, 2021
@dopplershift dopplershift mentioned this pull request Jul 2, 2021
1 task
This matches our previous configuration as closely as possible. Most of
the changes here either compress some lines or pick up a few imports
that weren't quite right.
While it gives less useful output than flake8-import-order, flake8-isort
by running isort uses our isort config. We can deal with the worse
output by just having people run isort.
Only the last one mattered anyway, but it's better for that to be at the
top of the file.
@dcamron dcamron merged commit 3f08b77 into Unidata:main Jul 7, 2021
@github-actions github-actions bot added this to the 1.1.0 milestone Jul 7, 2021
@dopplershift dopplershift deleted the isort branch July 7, 2021 18:53
Sign up for free to join this conversation on GitHub. Already have an account? Sign in to comment
Labels
Area: Infrastructure Pertains to project infrastructure (e.g. CI, linting) Type: Enhancement Enhancement to existing functionality
Projects
None yet
Development

Successfully merging this pull request may close these issues.

None yet

2 participants