Skip to content

Commit a2d8a51

Browse files
mohi7solankiByron
authored andcommitted
Fix#889: Add DeepSource config and fix some major issues
1 parent 0765792 commit a2d8a51

File tree

6 files changed

+29
-13
lines changed

6 files changed

+29
-13
lines changed

‎.deepsource.toml‎

Lines changed: 15 additions & 0 deletions
Original file line numberDiff line numberDiff line change
@@ -0,0 +1,15 @@
1+
version = 1
2+
3+
test_patterns = [
4+
'git/test/**/test_*.py'
5+
]
6+
7+
exclude_patterns = [
8+
'doc/**',
9+
'etc/sublime-text'
10+
]
11+
12+
[[analyzers]]
13+
name = 'python'
14+
enabled = true
15+
runtime_version = '2.x.x'

‎git/objects/submodule/base.py‎

Lines changed: 2 additions & 3 deletions
Original file line numberDiff line numberDiff line change
@@ -864,9 +864,8 @@ def remove(self, module=True, force=False, configuration=True, dry_run=False):
864864
rmtree(wtd)
865865
exceptExceptionasex:
866866
ifHIDE_WINDOWS_KNOWN_ERRORS:
867-
raiseSkipTest("FIXME: fails with: PermissionError\n %s", ex)
868-
else:
869-
raise
867+
raiseSkipTest("FIXME: fails with: PermissionError\n{}".format(ex))
868+
raise
870869
# END delete tree if possible
871870
# END handle force
872871

‎git/test/test_config.py‎

Lines changed: 1 addition & 1 deletion
Original file line numberDiff line numberDiff line change
@@ -38,7 +38,7 @@ def setUp(self):
3838
deftearDown(self):
3939
forlfpinglob.glob(_tc_lock_fpaths):
4040
ifosp.isfile(lfp):
41-
raiseAssertionError('Previous TC left hanging git-lock file: %s', lfp)
41+
raiseAssertionError('Previous TC left hanging git-lock file: {}'.format(lfp))
4242

4343
def_to_memcache(self, file_path):
4444
withopen(file_path, "rb") asfp:

‎git/test/test_git.py‎

Lines changed: 8 additions & 5 deletions
Original file line numberDiff line numberDiff line change
@@ -134,15 +134,18 @@ def test_it_accepts_environment_variables(self):
134134

135135
deftest_persistent_cat_file_command(self):
136136
# read header only
137-
importsubprocessassp
138137
hexsha="b2339455342180c7cc1e9bba3e9f181f7baa5167"
139-
g=self.git.cat_file(batch_check=True, istream=sp.PIPE, as_process=True)
138+
g=self.git.cat_file(
139+
batch_check=True, istream=subprocess.PIPE, as_process=True
140+
)
140141
g.stdin.write(b"b2339455342180c7cc1e9bba3e9f181f7baa5167\n")
141142
g.stdin.flush()
142143
obj_info=g.stdout.readline()
143144

144145
# read header + data
145-
g=self.git.cat_file(batch=True, istream=sp.PIPE, as_process=True)
146+
g=self.git.cat_file(
147+
batch=True, istream=subprocess.PIPE, as_process=True
148+
)
146149
g.stdin.write(b"b2339455342180c7cc1e9bba3e9f181f7baa5167\n")
147150
g.stdin.flush()
148151
obj_info_two=g.stdout.readline()
@@ -160,7 +163,7 @@ def test_persistent_cat_file_command(self):
160163

161164
# same can be achieved using the respective command functions
162165
hexsha, typename, size=self.git.get_object_header(hexsha)
163-
hexsha, typename_two, size_two, data=self.git.get_object_data(hexsha)# @UnusedVariable
166+
hexsha, typename_two, size_two, _=self.git.get_object_data(hexsha)
164167
self.assertEqual(typename, typename_two)
165168
self.assertEqual(size, size_two)
166169

@@ -264,7 +267,7 @@ def test_environment(self, rw_dir):
264267
remote.fetch()
265268
exceptGitCommandErroraserr:
266269
ifsys.version_info[0] <3andis_darwin:
267-
self.assertIn('ssh-orig, 'instr(err))
270+
self.assertIn('ssh-orig',str(err))
268271
self.assertEqual(err.status, 128)
269272
else:
270273
self.assertIn('FOO', str(err))

‎git/test/test_repo.py‎

Lines changed: 1 addition & 1 deletion
Original file line numberDiff line numberDiff line change
@@ -90,7 +90,7 @@ def setUp(self):
9090
deftearDown(self):
9191
forlfpinglob.glob(_tc_lock_fpaths):
9292
ifosp.isfile(lfp):
93-
raiseAssertionError('Previous TC left hanging git-lock file: %s', lfp)
93+
raiseAssertionError('Previous TC left hanging git-lock file: {}'.format(lfp))
9494
importgc
9595
gc.collect()
9696

‎git/util.py‎

Lines changed: 2 additions & 3 deletions
Original file line numberDiff line numberDiff line change
@@ -98,9 +98,8 @@ def onerror(func, path, exc_info):
9898
func(path) # Will scream if still not possible to delete.
9999
exceptExceptionasex:
100100
ifHIDE_WINDOWS_KNOWN_ERRORS:
101-
raiseSkipTest("FIXME: fails with: PermissionError\n %s", ex)
102-
else:
103-
raise
101+
raiseSkipTest("FIXME: fails with: PermissionError\n{}".format(ex))
102+
raise
104103

105104
returnshutil.rmtree(path, False, onerror)
106105

0 commit comments

Comments
(0)