Skip to content

Commit b9b3549

Browse files
committed
Make flake8 enforce PEP8 max line length of 80
close #434
1 parent 2b5ffb1 commit b9b3549

File tree

3 files changed

+12
-15
lines changed

3 files changed

+12
-15
lines changed

.travis.yml

Lines changed: 1 addition & 1 deletion
Original file line numberDiff line numberDiff line change
@@ -18,7 +18,7 @@ install:
1818
- pip install -r requirements-travis.txt
1919

2020
before_script:
21-
- flake8 ./exercises/ --max-line-length=99 --select=E,W
21+
- flake8
2222

2323
script:
2424
- ./test/check-exercises.py

README.md

Lines changed: 2 additions & 6 deletions
Original file line numberDiff line numberDiff line change
@@ -34,13 +34,9 @@ python test/check-exercises.py
3434

3535
## Code Style
3636

37-
The Python code in this repo is meant to largely obey the [PEP8 style guide](https://www.python.org/dev/peps/pep-0008/).
37+
The Python code in this repo is meant to follow the [PEP8 style guide](https://www.python.org/dev/peps/pep-0008/).
3838

39-
This repo uses [flake8](http://flake8.readthedocs.org/en/latest/) to enforce the coding standard. When you submit a PR, it needs to pass the flake8 tool with no warnings, or it won't be accepted. Here are the settings used by the build system:
40-
41-
```
42-
flake8 [your-code-here.py] --max-line-length=99 --select=E,W
43-
```
39+
This repo uses [flake8](http://flake8.readthedocs.org/en/latest/) with default settings to enforce the coding standard. When you submit a PR, it needs to pass the flake8 tool with no warnings, or it won't be accepted.
4440

4541
## Pull Requests
4642

exercises/word-search/example.py

Lines changed: 9 additions & 8 deletions
Original file line numberDiff line numberDiff line change
@@ -19,7 +19,7 @@ def __eq__(self, other):
1919
return self.x == other.x and self.y == other.y
2020

2121
def __ne__(self, other):
22-
return not(self == other)
22+
return not (self == other)
2323

2424

2525
DIRECTIONS = (Point(1, 0), Point(1, -1), Point(1, 1), Point(-1, -1),
@@ -40,15 +40,16 @@ def find_char(self, coordinate):
4040
return self.rows[coordinate.y][coordinate.x]
4141

4242
def find(self, word, position, direction):
43-
current = copy.copy(position)
44-
for letter in word:
45-
if self.find_char(current) != letter:
46-
return
47-
current += direction
48-
return position, current - direction
43+
current = copy.copy(position)
44+
for letter in word:
45+
if self.find_char(current) != letter:
46+
return
47+
current += direction
48+
return position, current - direction
4949

5050
def search(self, word):
51-
positions = (Point(x, y) for x in range(self.width) for y in range(self.height))
51+
positions = (Point(x, y)
52+
for x in range(self.width) for y in range(self.height))
5253
for pos in positions:
5354
for d in DIRECTIONS:
5455
result = self.find(word, pos, d)

0 commit comments

Comments
 (0)