Skip to content

Commit 74468d4

Browse files
author
Thomas Grainger
committed
fix max line length in src
1 parent a4a0dba commit 74468d4

File tree

5 files changed

+316
-295
lines changed

5 files changed

+316
-295
lines changed

tox.ini

Lines changed: 0 additions & 4 deletions
Original file line numberDiff line numberDiff line change
@@ -10,7 +10,3 @@ deps =
1010
deps =
1111
flake8==3.3.0
1212
commands=flake8 whatthepatch tests
13-
14-
[flake8]
15-
ignore = E121,E123,E126,E128,E131,E226,E231,E241,E251,E261,E265,E302,E303,E305,E731,F401,F841,W391,W503
16-
max-line-length = 176

whatthepatch/__init__.py

Lines changed: 2 additions & 0 deletions
Original file line numberDiff line numberDiff line change
@@ -2,3 +2,5 @@
22

33
from .patch import parse_patch
44
from .apply import apply_diff
5+
6+
__all__ = ['parse_patch', 'apply_diff']

whatthepatch/apply.py

Lines changed: 5 additions & 8 deletions
Original file line numberDiff line numberDiff line change
@@ -1,11 +1,11 @@
11
# -*- coding: utf-8 -*-
22

3-
import re
43
import subprocess
54

65
from . import patch
76
from .snippets import which, remove
87

8+
99
def apply_patch(diffs):
1010
""" Not ready for use yet """
1111
pass
@@ -24,6 +24,7 @@ def apply_patch(diffs):
2424
with open(diff.header.new_path, 'w') as f:
2525
f.write(new_text)
2626

27+
2728
def apply_diff(diff, text, use_patch=False):
2829
try:
2930
lines = text.splitlines()
@@ -33,7 +34,7 @@ def apply_diff(diff, text, use_patch=False):
3334
if use_patch:
3435
# call out to patch program
3536
patchexec = which('patch')
36-
assert patchexec # patch program does not exist
37+
assert patchexec # patch program does not exist
3738

3839
filepath = '/tmp/wtp-' + str(hash(diff.header))
3940
oldfilepath = filepath + '.old'
@@ -55,7 +56,6 @@ def apply_diff(diff, text, use_patch=False):
5556
]
5657
ret = subprocess.call(args)
5758

58-
5959
with open(newfilepath) as f:
6060
lines = f.read().splitlines()
6161

@@ -71,7 +71,7 @@ def apply_diff(diff, text, use_patch=False):
7171
remove(patchfilepath)
7272

7373
# do this last to ensure files get cleaned up
74-
assert ret == 0 # patch return code is success
74+
assert ret == 0 # patch return code is success
7575

7676
return lines, rejlines
7777

@@ -95,13 +95,10 @@ def apply_diff(diff, text, use_patch=False):
9595
i += 1
9696
elif old is not None and new is not None:
9797
# are we crazy?
98-
#assert new == old - r + i
98+
# assert new == old - r + i
9999

100100
# Sometimes, people remove hunks from patches, making these
101101
# numbers completely unreliable. Because they're jerks.
102102
pass
103103

104104
return lines
105-
106-
107-

0 commit comments

Comments
 (0)