Skip to content

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

@rbranche

Description

@rbranche
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):

Metadata

Metadata

Assignees

No one assigned

    Labels

    Type

    No type

    Projects

    No projects

    Milestone

    No milestone

    Relationships

    None yet

    Development

    No branches or pull requests

    Issue actions