Skip to content

Commit 3de0009

Browse files
author
zhenwei-li
committed
适配 flake8 lint 规则
1 parent bcbb99e commit 3de0009

2 files changed

Lines changed: 11 additions & 9 deletions

File tree

src/com/dvsnier/git/branch/branch.py

Lines changed: 10 additions & 8 deletions
Original file line numberDiff line numberDiff line change
@@ -34,26 +34,30 @@ def get_branch(self):
3434
def branch_to_file_and_commit_list(self):
3535
'the execute origin branch commit record list that to files'
3636
return execute([
37-
'git branch --list --all --sort=committerdate --format=\'%(color:reset)%(HEAD) %(color:yellow)%(refname:short)%(color:reset)|%(color:red)%(objectname:short)\''
37+
"git branch --list --all --sort=committerdate --format=\'%(color:reset)%(HEAD) %(color:yellow)%(refname:short)%(color:reset)|\
38+
%(color:red)%(objectname:short)\'"
3839
])
3940

4041
def branch_to_file_and_commit_list_with_more(self):
4142
'''the execute origin branch more commit record list that to files
4243
4344
format one:
44-
git branch --list --all --sort=committerdate --format=\'%(HEAD) %(color:yellow)%(refname:short)%(color:reset)|%(color:red)%(objectname:short)%(color:reset)|%(color:reset)%(contents:subject)|%(authorname)|%(color:reset)(%(color:green)%(committerdate:relative)%(color:reset))\'
45+
git branch --list --all --sort=committerdate --format=\'%(HEAD) %(color:yellow)%(refname:short)%(color:reset)|
46+
%(color:red)%(objectname:short)%(color:reset)|%(color:reset)%(contents:subject)|%(authorname)|%(color:reset)(%(color:green)%(committerdate:relative)%(color:reset))\'
4547
4648
format two:
47-
git branch --list --all --sort=committerdate --format=\'%(HEAD) %(color:yellow)%(refname:short)%(color:reset)|%(color:red)%(objectname:short)%(color:reset)|%(color:reset)(%(color:green)%(committerdate:relative)%(color:reset))\'
49+
git branch --list --all --sort=committerdate --format=\'%(HEAD) %(color:yellow)%(refname:short)%(color:reset)|
50+
%(color:red)%(objectname:short)%(color:reset)|%(color:reset)(%(color:green)%(committerdate:relative)%(color:reset))\'
4851
'''
4952
return execute([
50-
'git branch --list --all --sort=committerdate --format=\'%(HEAD) %(color:yellow)%(refname:short)%(color:reset)|%(color:red)%(objectname:short)%(color:reset)|%(color:reset)(%(color:green)%(committerdate:relative)%(color:reset))\''
53+
"git branch --list --all --sort=committerdate --format=\'%(HEAD) %(color:yellow)%(refname:short)%(color:reset)|%(color:red)\
54+
%(objectname:short)%(color:reset)|%(color:reset)(%(color:green)%(committerdate:relative)%(color:reset))\'"
5155
])
5256

5357
def branch_set_upstream_to(self, branch_name):
5458
''' the track remote and local branch associations '''
5559
if not branch_name or not len(branch_name.strip()) > 0:
56-
logging.exception('the current branch name is invalid.' )
60+
logging.exception('the current branch name is invalid.')
5761
raise KeyError('the current branch name is invalid.')
5862
return execute([
5963
'git branch -u origin/{0} {0}'.format(branch_name)
@@ -66,8 +70,6 @@ def get_current_branch_name(self):
6670
def set_current_branch_name(self, branch_name):
6771
''' the set current branch name '''
6872
if not branch_name or not len(branch_name.strip()) > 0:
69-
logging.exception('the current branch name is invalid.' )
73+
logging.exception('the current branch name is invalid.')
7074
raise KeyError('the current branch name is invalid.')
7175
self._current_branch_name = branch_name
72-
73-

tests/com/dvsnier/git/branch/test_branch.py

Lines changed: 1 addition & 1 deletion
Original file line numberDiff line numberDiff line change
@@ -57,7 +57,7 @@ def test_3_branch_set_upstream_to(self):
5757
self.assertIsNotNone(branch_set_upstream_to, 'test_3_branch_set_upstream_to is error.')
5858

5959
def test_5_get_current_branch_name(self):
60-
branch_name = Test_Branch._branch.get_branch()
60+
# branch_name = Test_Branch._branch.get_branch()
6161
# branch_name = None
6262
# branch_name = ''
6363
# branch_name = ' '

0 commit comments

Comments
 (0)