Skip to content

Commit aa7ffef

Browse files
committed
Make Flake8 to be a dependency.
1 parent 45a36d3 commit aa7ffef

File tree

5 files changed

+30
-8
lines changed

5 files changed

+30
-8
lines changed

.flake8

+2
Original file line numberDiff line numberDiff line change
@@ -0,0 +1,2 @@
1+
[flake8]
2+
max-line-length = 100

.travis.yml

+1-5
Original file line numberDiff line numberDiff line change
@@ -5,15 +5,11 @@ python:
55
# Install dependencies.
66
install:
77
- pip install -r requirements.txt
8-
- pip install flake8
98

109
# Run linting and tests.
1110
script:
12-
# stop the build if there are Python syntax errors or undefined names
13-
- flake8 . --count --select=E901,E999,F821,F822,F823 --show-source --statistics
14-
# exit-zero treats all errors as warnings. The GitHub editor is 127 chars wide
15-
- flake8 . --count --exit-zero --max-complexity=12 --max-line-length=127 --statistics
1611
- pylint ./src
12+
- flake8 ./src --statistics --count
1713
- pytest
1814

1915
# Turn email notifications off.

README.md

+22-1
Original file line numberDiff line numberDiff line change
@@ -174,7 +174,9 @@ pytest ./path/to/the/test_file.py
174174

175175
## Linting the Code
176176

177-
Linting is done using [pylint](http://pylint.pycqa.org/) library.
177+
Linting is done using [pylint](http://pylint.pycqa.org/) and [flake8](http://flake8.pycqa.org/en/latest/) libraries.
178+
179+
### PyLint
178180

179181
To check if the code is written with respect
180182
to [PEP 8](https://www.python.org/dev/peps/pep-0008/) style guide please run:
@@ -189,3 +191,22 @@ specific error by running:
189191
```bash
190192
pylint --help-msg=missing-docstring
191193
```
194+
195+
[More about PyLint](http://pylint.pycqa.org/)
196+
197+
### Flake8
198+
199+
To check if the code is written with respect
200+
to [PEP 8](https://www.python.org/dev/peps/pep-0008/) style guide please run:
201+
202+
```bash
203+
flake8 ./src
204+
```
205+
206+
Or if you want to have more detailed output you may run:
207+
208+
```bash
209+
flake8 ./src --statistics --show-source --count
210+
```
211+
212+
[More about Flake8](http://flake8.pycqa.org/en/latest/)

requirements.txt

+4-1
Original file line numberDiff line numberDiff line change
@@ -1,13 +1,16 @@
11
astroid==2.0.4
22
atomicwrites==1.1.5
33
attrs==18.1.0
4+
flake8==3.5.0
45
isort==4.3.4
56
lazy-object-proxy==1.3.1
67
mccabe==0.6.1
78
more-itertools==4.3.0
89
pluggy==0.7.1
910
py==1.5.4
11+
pycodestyle==2.3.1
12+
pyflakes==1.6.0
1013
pylint==2.1.1
1114
pytest==3.7.2
1215
six==1.11.0
13-
wrapt==1.10.11
16+
wrapt==1.10.11

src/modules/test_modules.py

+1-1
Original file line numberDiff line numberDiff line change
@@ -39,7 +39,6 @@
3939
# It can also be used when utilising from with similar effects:
4040
from fibonacci_module import fibonacci_at_position as fibonacci_at_position_renamed
4141

42-
4342
# When a module named spam is imported, the interpreter first searches for a built-in module with
4443
# that name. If not found, it then searches for a file named spam.py in a list of directories
4544
# given by the variable sys.path. sys.path is initialized from these locations:
@@ -48,6 +47,7 @@
4847
# - PYTHONPATH (a list of directory names, with the same syntax as the shell variable PATH).
4948
# - The installation-dependent default.
5049

50+
5151
def test_modules():
5252
"""Modules"""
5353

0 commit comments

Comments
 (0)