Skip to content
This repository has been archived by the owner on Nov 3, 2023. It is now read-only.

Fix IndexError on strange backslash docstring #506

Merged
merged 2 commits into from
Aug 29, 2020
Merged

Fix IndexError on strange backslash docstring #506

merged 2 commits into from
Aug 29, 2020

Conversation

asottile
Copy link
Member

@asottile asottile commented Aug 25, 2020

Thanks for submitting a PR!

Please make sure to check for the following items:

  • Add unit tests and integration tests where applicable.
    If you've added an error code or changed an error code behavior,
    you should probably add or change a test case file under tests/test_cases/ and add
    it to the list under tests/test_definitions.py.
    If you've added or changed a command line option,
    you should probably add or change a test in tests/test_integration.py.
  • Add a line to the release notes (docs/release_notes.rst) under "Current Development Version".
    Make sure to include the PR number after you open and get one.

Please don't get discouraged as it may take a while to get a review.

Resolves #505

if (len(indents) > 1 and min(indents[:-1]) > indent or
indents[-1] > indent):
if (
len(indents) > 1 and min(indents[:-1]) > indent or
Copy link
Member

Choose a reason for hiding this comment

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

Probably worth putting brackets for clarity here?

Copy link
Member Author

Choose a reason for hiding this comment

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

there weren't brackets before, the newline I think is enough to differentiate, I can change it if you insist (or you can push to the PR if you like)

yield violations.D208()
if min(indents) < indent:
if len(indents) > 0 and min(indents) < indent:
Copy link
Member

Choose a reason for hiding this comment

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

replace len(indents) > 0

with if indents and....

Copy link
Member Author

Choose a reason for hiding this comment

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

So, I wanted this to match the > 1 above for clarity, it looks weirder not doing that -- I can change it if you insist but I felt it better to be consistent

ssbarnea
ssbarnea previously approved these changes Aug 29, 2020
@ssbarnea
Copy link
Member

ssbarnea commented Aug 29, 2020

@samj1912 Can you please accept the patch and create new tag?

That bug is quite nasty from the user point of view: it prevents upgrading flake8 by crashing with a totally useless exception, one that even prevents us from seeing the file that is causing the issue. The patch seems to work fine.

ssbarnea added a commit to ansible/molecule that referenced this pull request Aug 29, 2020
Among normal bumping of linters temporary pins down pydocstyle due
to recent regression.

Related: PyCQA/pydocstyle#506
samj1912
samj1912 previously approved these changes Aug 29, 2020
ssbarnea added a commit to ansible/molecule that referenced this pull request Aug 29, 2020
Among normal bumping of linters temporary pins down pydocstyle due
to recent regression.

Related: PyCQA/pydocstyle#506
@samj1912
Copy link
Member

Will release the new version tonight :)

@samj1912 samj1912 dismissed stale reviews from ssbarnea and themself via 217c650 August 29, 2020 20:48
@samj1912 samj1912 merged commit 4e467fe into PyCQA:master Aug 29, 2020
@asottile asottile deleted the weird_backslash branch August 29, 2020 20:54
@samj1912
Copy link
Member

Released :)

Sign up for free to subscribe to this conversation on GitHub. Already have an account? Sign in.
Labels
None yet
Projects
None yet
Development

Successfully merging this pull request may close these issues.

IndexError on one-line backslash docstring
3 participants