Skip to content

Commit fe426d4

Browse files
committed
Minor Flake8 fixes.
Latest version of it is required to show the issues travis shows as well
1 parent 756b7ad commit fe426d4

File tree

4 files changed

+13
-9
lines changed

4 files changed

+13
-9
lines changed

git/index/fun.py

+3-3
Original file line numberDiff line numberDiff line change
@@ -10,8 +10,6 @@
1010
S_IFREG,
1111
)
1212

13-
S_IFGITLINK = S_IFLNK | S_IFDIR # a submodule
14-
1513
from io import BytesIO
1614
import os
1715
import subprocess
@@ -33,7 +31,6 @@
3331
CE_NAMEMASK,
3432
CE_STAGESHIFT
3533
)
36-
CE_NAMEMASK_INV = ~CE_NAMEMASK
3734

3835
from .util import (
3936
pack,
@@ -47,6 +44,9 @@
4744
force_text
4845
)
4946

47+
S_IFGITLINK = S_IFLNK | S_IFDIR # a submodule
48+
CE_NAMEMASK_INV = ~CE_NAMEMASK
49+
5050
__all__ = ('write_cache', 'read_cache', 'write_tree_from_cache', 'entry_key',
5151
'stat_mode_to_index_mode', 'S_IFGITLINK', 'run_commit_hook', 'hook_path')
5252

git/test/lib/helper.py

+6-4
Original file line numberDiff line numberDiff line change
@@ -15,7 +15,9 @@
1515
from git import Repo, Remote, GitCommandError, Git
1616
from git.compat import string_types
1717

18-
GIT_REPO = os.environ.get("GIT_PYTHON_TEST_GIT_REPO_BASE", os.path.dirname(os.path.dirname(os.path.dirname(os.path.dirname(__file__)))))
18+
osp = os.path.dirname
19+
20+
GIT_REPO = os.environ.get("GIT_PYTHON_TEST_GIT_REPO_BASE", osp(osp(osp(osp(__file__)))))
1921

2022
__all__ = (
2123
'fixture_path', 'fixture', 'absolute_project_path', 'StringProcessAdapter',
@@ -26,7 +28,7 @@
2628

2729

2830
def fixture_path(name):
29-
test_dir = os.path.dirname(os.path.dirname(__file__))
31+
test_dir = osp(osp(__file__))
3032
return os.path.join(test_dir, "fixtures", name)
3133

3234

@@ -35,7 +37,7 @@ def fixture(name):
3537

3638

3739
def absolute_project_path():
38-
return os.path.abspath(os.path.join(os.path.dirname(__file__), "..", ".."))
40+
return os.path.abspath(os.path.join(osp(__file__), "..", ".."))
3941

4042
#} END routines
4143

@@ -195,7 +197,7 @@ def remote_repo_creator(self):
195197

196198
d_remote.config_writer.set('url', remote_repo_url)
197199

198-
temp_dir = os.path.dirname(_mktemp())
200+
temp_dir = osp(_mktemp())
199201
# On windows, this will fail ... we deal with failures anyway and default to telling the user to do it
200202
try:
201203
gd = Git().daemon(temp_dir, enable='receive-pack', as_process=True)

git/test/test_base.py

+1-1
Original file line numberDiff line numberDiff line change
@@ -120,7 +120,7 @@ def test_add_unicode(self, rw_repo):
120120

121121
# verify first that we could encode file name in this environment
122122
try:
123-
_ = file_path.encode(sys.getfilesystemencoding())
123+
file_path.encode(sys.getfilesystemencoding())
124124
except UnicodeEncodeError:
125125
from nose import SkipTest
126126
raise SkipTest("Environment doesn't support unicode filenames")

tox.ini

+3-1
Original file line numberDiff line numberDiff line change
@@ -18,7 +18,9 @@ commands = {posargs}
1818
[flake8]
1919
#show-source = True
2020
# E265 = comment blocks like @{ section, which it can't handle
21+
# E266 = too many leading '#' for block comment
22+
# E731 = do not assign a lambda expression, use a def
2123
# W293 = Blank line contains whitespace
22-
ignore = E265,W293
24+
ignore = E265,W293,E266,E731
2325
max-line-length = 120
2426
exclude = .tox,.venv,build,dist,doc,git/ext/

0 commit comments

Comments
 (0)