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

skip_file ignored when on the first docstring line #1840

Closed
romaingz opened this issue Nov 3, 2021 · 4 comments
Closed

skip_file ignored when on the first docstring line #1840

romaingz opened this issue Nov 3, 2021 · 4 comments
Labels
bug Something isn't working

Comments

@romaingz
Copy link

romaingz commented Nov 3, 2021

This does not occur on version 5.9.3.

Since version 5.10.0, the following skip_file directive is ignored:

"""isort:skip_file"""

This is also ignored:

"""isort:skip_file

some other comment.
"""

It needs to be on a new line:

"""
isort:skip_file
"""
@Omegastick
Copy link

skip_file in a comment is also ignored.

#  isort:skip_file

@ahopkins
Copy link

ahopkins commented Nov 3, 2021

FWIW, this is also ignored, new line with whitespace.

"""
   isort:skip_file
"""

@max-sixty
Copy link

Here's an example of 5.10.0 ignoring directives (unless there's some intentional change I'm missing?): pydata/xarray#5949

timothycrosley added a commit that referenced this issue Nov 9, 2021
@timothycrosley
Copy link
Member

Sorry for the noise! This should be fixed in https://github.com/PyCQA/isort/releases/tag/5.10.1, a contribution meant to avoid false flagging of non-comment isort: skip-files, was to narrow and has been reverted. In the meantime additional test cases will be added to catch this going forward.

Thanks!

~Timothy

Sign up for free to join this conversation on GitHub. Already have an account? Sign in to comment
Labels
bug Something isn't working
Projects
None yet
Development

No branches or pull requests

5 participants