Skip to content

STYLE: fix line length check of flake8 #27307

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

Merged

Conversation

jorisvandenbossche
Copy link
Member

I think I made a small mistake in #27076 in adding the E501 code (line length) to the ignore list, as setting the flake8 max line length to 88 should have been sufficient.

Black does not check or correct line length in comments or multiline strings (eg docstrings), so this still need to be catched by flake8

@jorisvandenbossche
Copy link
Member Author

But, this gives some interesting cases, it seems not always easy to reconcile both ...

@@ -284,7 +284,7 @@ def __init__(
if self.name is None:
self.name = index.names[level]

self.grouper, self._labels, self._group_index = index._get_grouper_for_level(
self.grouper, self._labels, self._group_index = index._get_grouper_for_level( # noqa
Copy link
Member Author

Choose a reason for hiding this comment

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

this is a case where black produces too long line lengths (the original code before black was using \ after = for line continuation, but checked, and black always removes this when adding it back.

For now just adding # noqa for this and similar cases (long term the code could be refactored a bit too avoid this, but now just fixing flake8)

Copy link
Member

Choose a reason for hiding this comment

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

Makes sense to me!

Copy link
Member

Choose a reason for hiding this comment

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

Actually can you add # noqa: E501 to these? I suppose makes sense to only filter the line length error here

@@ -284,7 +284,7 @@ def __init__(
if self.name is None:
self.name = index.names[level]

self.grouper, self._labels, self._group_index = index._get_grouper_for_level(
self.grouper, self._labels, self._group_index = index._get_grouper_for_level( # noqa
Copy link
Member

Choose a reason for hiding this comment

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

Actually can you add # noqa: E501 to these? I suppose makes sense to only filter the line length error here

@WillAyd WillAyd added the Code Style Code style, linting, code_checks label Jul 9, 2019
@jreback jreback added this to the 0.25.0 milestone Jul 9, 2019
@jreback jreback merged commit 1e42600 into pandas-dev:master Jul 9, 2019
@jreback
Copy link
Contributor

jreback commented Jul 9, 2019

thanks @jorisvandenbossche

Sign up for free to join this conversation on GitHub. Already have an account? Sign in to comment
Labels
Code Style Code style, linting, code_checks
Projects
None yet
Development

Successfully merging this pull request may close these issues.

3 participants