| FazBrowse GitHub Viewer | Trending | | Home |
| Tools: [Download Repo ZIP] [Original HTTPS Page] |
8 files changed
| Original file line number | Diff line number | Diff line change | |
|---|---|---|---|
@@ -34,6 +34,7 @@ Contributors are: | |||
| 34 | 34 | -Stefan Stancu <stefan.stancu _at_ gmail.com> | |
| 35 | 35 | -César Izurieta <cesar _at_ caih.org> | |
| 36 | 36 | -Arthur Milchior <arthur _at_ milchior.fr> | |
| 37 | + -Anil Khatri <anil.soccer.khatri _at_ gmail.com> | ||
| 37 | 38 | -JJ Graham <thetwoj _at_ gmail.com> | |
| 38 | 39 | -Ben Thayer <ben _at_ benthayer.com> | |
| 39 | 40 | ||
| Original file line number | Diff line number | Diff line change | |
|---|---|---|---|
@@ -503,6 +503,7 @@ def readlines(self, size=-1): | |||
| 503 | 503 | # END readline loop | |
| 504 | 504 | return out | |
| 505 | 505 | ||
| 506 | + # skipcq: PYL-E0301 | ||
| 506 | 507 | def __iter__(self): | |
| 507 | 508 | return self | |
| 508 | 509 | ||
| Original file line number | Diff line number | Diff line change | |
|---|---|---|---|
@@ -432,13 +432,14 @@ def _index_from_patch_format(cls, repo, proc): | |||
| 432 | 432 | text = b''.join(text) | |
| 433 | 433 | index = DiffIndex() | |
| 434 | 434 | previous_header = None | |
| 435 | - for header in cls.re_header.finditer(text): | ||
| 435 | + header = None | ||
| 436 | + for _header in cls.re_header.finditer(text): | ||
| 436 | 437 | a_path_fallback, b_path_fallback, \ | |
| 437 | 438 | old_mode, new_mode, \ | |
| 438 | 439 | rename_from, rename_to, \ | |
| 439 | 440 | new_file_mode, deleted_file_mode, copied_file_name, \ | |
| 440 | 441 | a_blob_id, b_blob_id, b_mode, \ | |
| 441 | - a_path, b_path = header.groups() | ||
| 442 | + a_path, b_path = _header.groups() | ||
| 442 | 443 | ||
| 443 | 444 | new_file, deleted_file, copied_file = \ | |
| 444 | 445 | bool(new_file_mode), bool(deleted_file_mode), bool(copied_file_name) | |
@@ -449,7 +450,7 @@ def _index_from_patch_format(cls, repo, proc): | |||
| 449 | 450 | # Our only means to find the actual text is to see what has not been matched by our regex, | |
| 450 | 451 | # and then retro-actively assign it to our index | |
| 451 | 452 | if previous_header is not None: | |
| 452 | - index[-1].diff = text[previous_header.end():header.start()] | ||
| 453 | + index[-1].diff = text[previous_header.end():_header.start()] | ||
| 453 | 454 | # end assign actual diff | |
| 454 | 455 | ||
| 455 | 456 | # Make sure the mode is set if the path is set. Otherwise the resulting blob is invalid | |
@@ -468,7 +469,8 @@ def _index_from_patch_format(cls, repo, proc): | |||
| 468 | 469 | rename_to, | |
| 469 | 470 | None, None, None)) | |
| 470 | 471 | ||
| 471 | - previous_header = header | ||
| 472 | + previous_header = _header | ||
| 473 | + header = _header | ||
| 472 | 474 | # end for each header we parse | |
| 473 | 475 | if index: | |
| 474 | 476 | index[-1].diff = text[header.end():] | |
| Original file line number | Diff line number | Diff line change | |
|---|---|---|---|
@@ -5,7 +5,7 @@ | |||
| 5 | 5 | # the BSD License: http://www.opensource.org/licenses/bsd-license.php | |
| 6 | 6 | """ Module containing all exceptions thrown throughout the git package, """ | |
| 7 | 7 | ||
| 8 | - from gitdb.exc import * # NOQA @UnusedWildImport | ||
| 8 | + from gitdb.exc import * # NOQA @UnusedWildImport skipcq: PYL-W0401, PYL-W0614 | ||
| 9 | 9 | from git.compat import UnicodeMixin, safe_decode, string_types | |
| 10 | 10 | ||
| 11 | 11 | ||
| Original file line number | Diff line number | Diff line change | |
|---|---|---|---|
@@ -846,7 +846,7 @@ def remove(self, module=True, force=False, configuration=True, dry_run=False): | |||
| 846 | 846 | # have to manually delete references as python's scoping is | |
| 847 | 847 | # not existing, they could keep handles open ( on windows this is a problem ) | |
| 848 | 848 | if len(rrefs): | |
| 849 | - del(rref) | ||
| 849 | + del(rref) # skipcq: PYL-W0631 | ||
| 850 | 850 | # END handle remotes | |
| 851 | 851 | del(rrefs) | |
| 852 | 852 | del(remote) | |
| Original file line number | Diff line number | Diff line change | |
|---|---|---|---|
@@ -84,7 +84,7 @@ def message(self): | |||
| 84 | 84 | return self[4] | |
| 85 | 85 | ||
| 86 | 86 | @classmethod | |
| 87 | - def new(self, oldhexsha, newhexsha, actor, time, tz_offset, message): | ||
| 87 | + def new(cls, oldhexsha, newhexsha, actor, time, tz_offset, message): # skipcq: PYL-W0621 | ||
| 88 | 88 | """:return: New instance of a RefLogEntry""" | |
| 89 | 89 | if not isinstance(actor, Actor): | |
| 90 | 90 | raise ValueError("Need actor instance, got %s" % actor) | |
@@ -121,7 +121,7 @@ def from_line(cls, line): | |||
| 121 | 121 | # END handle missing end brace | |
| 122 | 122 | ||
| 123 | 123 | actor = Actor._from_string(info[82:email_end + 1]) | |
| 124 | - time, tz_offset = parse_date(info[email_end + 2:]) | ||
| 124 | + time, tz_offset = parse_date(info[email_end + 2:]) # skipcq: PYL-W0621 | ||
| 125 | 125 | ||
| 126 | 126 | return RefLogEntry((oldhexsha, newhexsha, actor, (time, tz_offset), msg)) | |
| 127 | 127 | ||
@@ -216,10 +216,9 @@ def entry_at(cls, filepath, index): | |||
| 216 | 216 | all other lines. Nonetheless, the whole file has to be read if | |
| 217 | 217 | the index is negative | |
| 218 | 218 | """ | |
| 219 | - fp = open(filepath, 'rb') | ||
| 220 | - if index < 0: | ||
| 221 | - return RefLogEntry.from_line(fp.readlines()[index].strip()) | ||
| 222 | - else: | ||
| 219 | + with open(filepath, 'rb') as fp: | ||
| 220 | + if index < 0: | ||
| 221 | + return RefLogEntry.from_line(fp.readlines()[index].strip()) | ||
| 223 | 222 | # read until index is reached | |
| 224 | 223 | for i in xrange(index + 1): | |
| 225 | 224 | line = fp.readline() | |
@@ -228,7 +227,7 @@ def entry_at(cls, filepath, index): | |||
| 228 | 227 | # END abort on eof | |
| 229 | 228 | # END handle runup | |
| 230 | 229 | ||
| 231 | - if i != index or not line: | ||
| 230 | + if i != index or not line: # skipcq:PYL-W0631 | ||
| 232 | 231 | raise IndexError | |
| 233 | 232 | # END handle exception | |
| 234 | 233 | ||
| Original file line number | Diff line number | Diff line change | |
|---|---|---|---|
@@ -349,7 +349,7 @@ def test_references_and_objects(self, rw_dir): | |||
| 349 | 349 | # The index contains all blobs in a flat list | |
| 350 | 350 | assert len(list(index.iter_blobs())) == len([o for o in repo.head.commit.tree.traverse() if o.type == 'blob']) | |
| 351 | 351 | # Access blob objects | |
| 352 | - for (path, _stage), entry in index.entries.items(): | ||
| 352 | + for (_path, _stage), entry in index.entries.items(): | ||
| 353 | 353 | pass | |
| 354 | 354 | new_file_path = os.path.join(repo.working_tree_dir, 'new-file-name') | |
| 355 | 355 | open(new_file_path, 'w').close() | |
| Original file line number | Diff line number | Diff line change | |
|---|---|---|---|
@@ -133,7 +133,7 @@ def join_path(a, *p): | |||
| 133 | 133 | '/' instead of possibly '\' on windows.""" | |
| 134 | 134 | path = a | |
| 135 | 135 | for b in p: | |
| 136 | - if len(b) == 0: | ||
| 136 | + if not b: | ||
| 137 | 137 | continue | |
| 138 | 138 | if b.startswith('/'): | |
| 139 | 139 | path += b[1:] | |
@@ -386,7 +386,7 @@ def _parse_progress_line(self, line): | |||
| 386 | 386 | # Compressing objects: 100% (2/2) | |
| 387 | 387 | # Compressing objects: 100% (2/2), done. | |
| 388 | 388 | self._cur_line = line = line.decode('utf-8') if isinstance(line, bytes) else line | |
| 389 | - if len(self.error_lines) > 0 or self._cur_line.startswith(('error:', 'fatal:')): | ||
| 389 | + if self.error_lines or self._cur_line.startswith(('error:', 'fatal:')): | ||
| 390 | 390 | self.error_lines.append(self._cur_line) | |
| 391 | 391 | return | |
| 392 | 392 | ||
| Back | FazBrowse Home | New Git URL |
0 commit comments