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

flake8diff doesn't seem to catch all whitespace errors that flake8 catches #24

Open
rbranche opened this issue Jun 22, 2015 · 1 comment
Labels

Comments

@rbranche
Copy link

lekonia:tests.git{test_flake8} ryan$ ryan$ flake8-diff
Found violations: restore.py
    E265 @ 89:1 - block comment should start with '# '
    W391 @ 1248:1 - blank line at end of file
1 ↵    
lekonia:tests.git{test_flake8} ryan$ flake8 restore.py
restore.py:89:1: E265 block comment should start with '# '
restore.py:92:1: E302 expected 2 blank lines, found 1
restore.py:1248:1: W391 blank line at end of file
1 ↵  
lekonia:tests.git{test_flake8} ryan$ git diff origin/master 2>/dev/null    
diff --git a/restore.py b/restore.py
index 84ba0e8..a91e473 100755
--- a/restore.py
+++ b/restore.py
@@ -86,6 +86,8 @@ CANARIES = [

 _FILE_SCHEMA = u"file://"

+#super bad flake8 code
+foo = True

 class RestoreTest(BaseTest):
     # Restore requires a device,
@@ -1243,3 +1245,4 @@ class RestoreTest(BaseTest):


 RestoreTest().execute_tests()
+

While the E302 was not in the changes per-se, it was introduced by the changes. flake8-diff should take into account the changed lines along with the immediately adjacent lines:

flake8-diff currently only looks at:

#super bad flake8 code
foo = True

But it should look at:

#super bad flake8 code
foo = True

class RestoreTest(BaseTest):
@gregarmer
Copy link
Collaborator

@rbranche thanks for the bug report!

We have something in the works that will help with this, in #22 - it'll hopefully land soon and I'll push a new version up to PyPI.

We'll also look into some ways to catch this in a less brute-force sort of way. I'm sure there are a few other cases very similar to this.

@gregarmer gregarmer added the bug label Jun 22, 2015
Sign up for free to join this conversation on GitHub. Already have an account? Sign in to comment
Labels
Projects
None yet
Development

No branches or pull requests

2 participants