Skip to content

Fix lint around unused and star imports - #245

Merged
brian-brazil merged 1 commit into
prometheus:masterfrom
bz2:lint_imports
Feb 16, 2018
Merged

brian-brazil merged 1 commit into
prometheus:masterfrom
bz2:lint_imports

Conversation

@bz2

@bz2 bz2 commented Feb 16, 2018

Copy link
Copy Markdown
Contributor

Resolves F401, F403, and F405.

Removes unused imports. Makes test imports explicit and consistent.

@brian-brazil brian-brazil left a comment

Copy link
Copy Markdown
Contributor

Choose a reason for hiding this comment

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

The unittests are failing

Comment thread tests/test_multiprocess.py Outdated

Copy link
Copy Markdown
Contributor

Choose a reason for hiding this comment

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

I'm not a big fan of these parens

Copy link
Copy Markdown
Contributor Author

Choose a reason for hiding this comment

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

I agree the import blocks aren't very nice, I'd generally just bring in the module and prefix everything, but for tests specifically it's at least clear what it being used by stating each name.

Specifically for parens, support was added in 2.4 and this multiline style is generally preferred:
https://www.python.org/dev/peps/pep-0328/
https://stackoverflow.com/questions/14376900/is-there-a-recommended-format-for-multi-line-imports

Resolves F401, F403, and F405.

Removes unused imports. Makes test imports explicit and consistent.
@bz2

bz2 commented Feb 16, 2018

Copy link
Copy Markdown
Contributor Author

Got too overzealous removing things, fixed.

@brian-brazil
brian-brazil merged commit c59f436 into prometheus:master Feb 16, 2018
@brian-brazil

Copy link
Copy Markdown
Contributor

Thanks!

Sign up for free to join this conversation on GitHub. Already have an account? Sign in to comment

Labels

None yet

Projects

None yet

Development

Successfully merging this pull request may close these issues.

2 participants