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

Add check for over-indented blocks #705

Merged
merged 1 commit into from
Jan 25, 2019
Merged

Add check for over-indented blocks #705

merged 1 commit into from
Jan 25, 2019

Conversation

jdufresne
Copy link
Contributor

In a project with all lines indented 4 spaces, I noticed pycodestyle was not catching code that was accidentally indented two levels (8 spaces). The over indentation was unintended and can be caught during static
analysis.

Fixes #430

@jdufresne
Copy link
Contributor Author

Rebased to resolve merge conflicts.

CHANGES.txt Outdated
@@ -20,6 +20,7 @@ New checks:
in Python 3.7. PR #684.
* Add E252 error for missing whitespace around equal sign in type annotated
function arguments with defaults values. PR #717.
* Add E117 error for over-indented code blocks.
Copy link
Member

Choose a reason for hiding this comment

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

I don't believe this is the right place to add this because 2.4.0 is already released

testsuite/W19.py Outdated
or trailing whitespace

or trailing whitespace
Copy link
Member

Choose a reason for hiding this comment

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

I'm pretty sure we wanted to keep those trailing white spaces

In a project with all lines indented 4 spaces, I noticed pycodestyle was
not catching code that was accidentally indented two levels (8 spaces).
The over indentation was unintended and can be caught during static
analysis.

Fixes #430
@jdufresne
Copy link
Contributor Author

Thanks for the review. I've updated the PR with the suggested changes. 🙂

@sigmavirus24 sigmavirus24 merged commit 2e0de4b into PyCQA:master Jan 25, 2019
@sciyoshi
Copy link

Hi @jdufresne @sigmavirus24, this change has started causing E117 to be reported for any files containing tabs. My guess is that this change sees them as being 8 spaces and thus being overindented. For now we will simply disable this error, but I think this should be addressed and I'll open a separate issue for this.

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.

3 participants