Skip to content

Commit

Permalink
Improves docs and tests
Browse files Browse the repository at this point in the history
  • Loading branch information
sobolevn committed Sep 24, 2018
1 parent f2c4fe9 commit 1caf499
Show file tree
Hide file tree
Showing 3 changed files with 49 additions and 0 deletions.
26 changes: 26 additions & 0 deletions README.md
Expand Up @@ -27,6 +27,32 @@ So, we ignore `--aggressive` option from `eradicate`.
|:----------:|:------------------------:|
| E800 | Found commented out code |

## Output example

```terminal
» flake8 tests/fixtures/incorrect.py
tests/fixtures/incorrect.py:1:1: E800: Found commented out code:
--- before/tests/fixtures/incorrect.py
+++ after/tests/fixtures/incorrect.py
@@ -1,16 +1,10 @@
class Some(object):
- # property_name = 1
other_property = 2
-# def function_name():
-# return None
-# class CommentedClass(object):
# def __init__(self) -> None:
-# self.property = None
# def __str__(self) -> str:
-# return self.__class__.__name__
```

## License

MIT.
19 changes: 19 additions & 0 deletions tests/fixtures/incorrect.py
@@ -1,4 +1,23 @@

class Some(object):
# property_name = 1
# typed_property: int = 10
other_property = 2


# def function_name():
# return None


# class CommentedClass(object):
# def __init__(self, prop: int) -> None:
# self.property = prop

# def __str__(self) -> str:
# return self.__class__.__name__

# def set_prop(self, prop: int):
# self.prop = prop

# def get_prop(self):
# return self.prop
4 changes: 4 additions & 0 deletions tests/test_comments.py
Expand Up @@ -27,3 +27,7 @@ def test_incorrect_fixture(absolute_path):
stdout, _ = process.communicate()

assert stdout.count(b'E800') == 1
assert b'- # property_name = 1' in stdout
assert b'- # typed_property: int = 10' in stdout
assert b'-# def function_name():' in stdout
assert b'-# class CommentedClass(object):' in stdout

0 comments on commit 1caf499

Please sign in to comment.