Skip to content

Commit 6035db0

Browse files
committed
Run black and exclude submodule
1 parent c6dab19 commit 6035db0

File tree

13 files changed

+10
-22
lines changed

13 files changed

+10
-22
lines changed

README.md

Lines changed: 2 additions & 0 deletions
Original file line numberDiff line numberDiff line change
@@ -110,6 +110,8 @@ To typecheck, run: `mypy -p git`
110110

111111
To test, run: `pytest`
112112

113+
For automatic code formatting run: `black git`
114+
113115
Configuration for flake8 is in the ./.flake8 file.
114116

115117
Configurations for mypy, pytest and coverage.py are in ./pyproject.toml.

git/cmd.py

Lines changed: 2 additions & 5 deletions
Original file line numberDiff line numberDiff line change
@@ -122,6 +122,7 @@ def handle_process_output(
122122
To specify a timeout in seconds for the git command, after which the process
123123
should be killed.
124124
"""
125+
125126
# Use 2 "pump" threads and wait for both to finish.
126127
def pump_stream(
127128
cmdline: List[str],
@@ -488,10 +489,7 @@ def check_unsafe_options(cls, options: List[str], unsafe_options: List[str]) ->
488489
"""
489490
# Options can be of the form `foo` or `--foo bar` `--foo=bar`,
490491
# so we need to check if they start with "--foo" or if they are equal to "foo".
491-
bare_unsafe_options = [
492-
option.lstrip("-")
493-
for option in unsafe_options
494-
]
492+
bare_unsafe_options = [option.lstrip("-") for option in unsafe_options]
495493
for option in options:
496494
for unsafe_option, bare_option in zip(unsafe_options, bare_unsafe_options):
497495
if option.startswith(unsafe_option) or option == bare_option:
@@ -1194,7 +1192,6 @@ def transform_kwargs(self, split_single_char_options: bool = True, **kwargs: Any
11941192

11951193
@classmethod
11961194
def _unpack_args(cls, arg_list: Sequence[str]) -> List[str]:
1197-
11981195
outlist = []
11991196
if isinstance(arg_list, (list, tuple)):
12001197
for arg in arg_list:

git/config.py

Lines changed: 1 addition & 2 deletions
Original file line numberDiff line numberDiff line change
@@ -248,7 +248,6 @@ def items_all(self) -> List[Tuple[str, List[_T]]]:
248248

249249

250250
def get_config_path(config_level: Lit_config_levels) -> str:
251-
252251
# we do not support an absolute path of the gitconfig on windows ,
253252
# use the global config instead
254253
if is_win and config_level == "system":
@@ -655,7 +654,7 @@ def write_section(name: str, section_dict: _OMD) -> None:
655654

656655
values: Sequence[str] # runtime only gets str in tests, but should be whatever _OMD stores
657656
v: str
658-
for (key, values) in section_dict.items_all():
657+
for key, values in section_dict.items_all():
659658
if key == "__name__":
660659
continue
661660

git/diff.py

Lines changed: 1 addition & 2 deletions
Original file line numberDiff line numberDiff line change
@@ -145,7 +145,7 @@ def diff(
145145
args.append("--full-index") # get full index paths, not only filenames
146146

147147
# remove default '-M' arg (check for renames) if user is overriding it
148-
if not any(x in kwargs for x in ('find_renames', 'no_renames', 'M')):
148+
if not any(x in kwargs for x in ("find_renames", "no_renames", "M")):
149149
args.append("-M")
150150

151151
if create_patch:
@@ -338,7 +338,6 @@ def __init__(
338338
change_type: Optional[Lit_change_type],
339339
score: Optional[int],
340340
) -> None:
341-
342341
assert a_rawpath is None or isinstance(a_rawpath, bytes)
343342
assert b_rawpath is None or isinstance(b_rawpath, bytes)
344343
self.a_rawpath = a_rawpath

git/exc.py

Lines changed: 0 additions & 2 deletions
Original file line numberDiff line numberDiff line change
@@ -139,7 +139,6 @@ def __init__(
139139
valid_files: Sequence[PathLike],
140140
failed_reasons: List[str],
141141
) -> None:
142-
143142
Exception.__init__(self, message)
144143
self.failed_files = failed_files
145144
self.failed_reasons = failed_reasons
@@ -170,7 +169,6 @@ def __init__(
170169
stderr: Union[bytes, str, None] = None,
171170
stdout: Union[bytes, str, None] = None,
172171
) -> None:
173-
174172
super(HookExecutionError, self).__init__(command, status, stderr, stdout)
175173
self._msg = "Hook('%s') failed%s"
176174

git/index/fun.py

Lines changed: 0 additions & 1 deletion
Original file line numberDiff line numberDiff line change
@@ -394,7 +394,6 @@ def aggressive_tree_merge(odb: "GitCmdObjectDB", tree_shas: Sequence[bytes]) ->
394394
out.append(_tree_entry_to_baseindexentry(theirs, 0))
395395
# END handle modification
396396
else:
397-
398397
if ours[0] != base[0] or ours[1] != base[1]:
399398
# they deleted it, we changed it, conflict
400399
out.append(_tree_entry_to_baseindexentry(base, 1))

git/objects/commit.py

Lines changed: 1 addition & 3 deletions
Original file line numberDiff line numberDiff line change
@@ -345,9 +345,7 @@ def trailers(self) -> Dict[str, str]:
345345
Dictionary containing whitespace stripped trailer information.
346346
Only contains the latest instance of each trailer key.
347347
"""
348-
return {
349-
k: v[0] for k, v in self.trailers_dict.items()
350-
}
348+
return {k: v[0] for k, v in self.trailers_dict.items()}
351349

352350
@property
353351
def trailers_list(self) -> List[Tuple[str, str]]:

git/objects/fun.py

Lines changed: 0 additions & 1 deletion
Original file line numberDiff line numberDiff line change
@@ -190,7 +190,6 @@ def traverse_trees_recursive(
190190
# is a tree. If the match is a non-tree item, put it into the result.
191191
# Processed items will be set None
192192
for ti, tree_data in enumerate(trees_data):
193-
194193
for ii, item in enumerate(tree_data):
195194
if not item:
196195
continue

git/objects/util.py

Lines changed: 1 addition & 1 deletion
Original file line numberDiff line numberDiff line change
@@ -143,7 +143,7 @@ def utctz_to_altz(utctz: str) -> int:
143143
:param utctz: git utc timezone string, i.e. +0200
144144
"""
145145
int_utctz = int(utctz)
146-
seconds = ((abs(int_utctz) // 100) * 3600 + (abs(int_utctz) % 100) * 60)
146+
seconds = (abs(int_utctz) // 100) * 3600 + (abs(int_utctz) % 100) * 60
147147
return seconds if int_utctz < 0 else -seconds
148148

149149

git/remote.py

Lines changed: 0 additions & 1 deletion
Original file line numberDiff line numberDiff line change
@@ -826,7 +826,6 @@ def _get_fetch_info_from_stderr(
826826
progress: Union[Callable[..., Any], RemoteProgress, None],
827827
kill_after_timeout: Union[None, float] = None,
828828
) -> IterableList["FetchInfo"]:
829-
830829
progress = to_progress_instance(progress)
831830

832831
# skip first line as it is some remote info we are not interested in

0 commit comments

Comments
 (0)
pFad - Phonifier reborn

Pfad - The Proxy pFad of © 2024 Garber Painting. All rights reserved.

Note: This service is not intended for secure transactions such as banking, social media, email, or purchasing. Use at your own risk. We assume no liability whatsoever for broken pages.


Alternative Proxies:

Alternative Proxy

pFad Proxy

pFad v3 Proxy

pFad v4 Proxy