Movatterモバイル変換


[0]ホーム

URL:


Skip to content

Navigation Menu

Sign in
Appearance settings

Search code, repositories, users, issues, pull requests...

Provide feedback

We read every piece of feedback, and take your input very seriously.

Saved searches

Use saved searches to filter your results more quickly

Sign up
Appearance settings

Commit6035db0

Browse files
committed
Run black and exclude submodule
1 parentc6dab19 commit6035db0

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
defpump_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-
foroptioninunsafe_options
494-
]
492+
bare_unsafe_options= [option.lstrip("-")foroptioninunsafe_options]
495493
foroptioninoptions:
496494
forunsafe_option,bare_optioninzip(unsafe_options,bare_unsafe_options):
497495
ifoption.startswith(unsafe_option)oroption==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
ifisinstance(arg_list, (list,tuple)):
12001197
forarginarg_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
defget_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
ifis_winandconfig_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)insection_dict.items_all():
657+
forkey,valuesinsection_dict.items_all():
659658
ifkey=="__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-
ifnotany(xinkwargsforxin ('find_renames','no_renames','M')):
148+
ifnotany(xinkwargsforxin ("find_renames","no_renames","M")):
149149
args.append("-M")
150150

151151
ifcreate_patch:
@@ -338,7 +338,6 @@ def __init__(
338338
change_type:Optional[Lit_change_type],
339339
score:Optional[int],
340340
)->None:
341-
342341
asserta_rawpathisNoneorisinstance(a_rawpath,bytes)
343342
assertb_rawpathisNoneorisinstance(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
ifours[0]!=base[0]orours[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]fork,vinself.trailers_dict.items()
350-
}
348+
return {k:v[0]fork,vinself.trailers_dict.items()}
351349

352350
@property
353351
deftrailers_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
forti,tree_datainenumerate(trees_data):
193-
194193
forii,iteminenumerate(tree_data):
195194
ifnotitem:
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
returnsecondsifint_utctz<0else-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

‎git/repo/base.py

Lines changed: 1 addition & 2 deletions
Original file line numberDiff line numberDiff line change
@@ -498,7 +498,7 @@ def delete_head(self, *heads: "Union[str, Head]", **kwargs: Any) -> None:
498498
defcreate_tag(
499499
self,
500500
path:PathLike,
501-
ref:Union[str,'SymbolicReference']="HEAD",
501+
ref:Union[str,"SymbolicReference"]="HEAD",
502502
message:Optional[str]=None,
503503
force:bool=False,
504504
**kwargs:Any,
@@ -548,7 +548,6 @@ def _get_config_path(self, config_level: Lit_config_levels, git_dir: Optional[Pa
548548
else:
549549
returnosp.normpath(osp.join(repo_dir,"config"))
550550
else:
551-
552551
assert_never(# type:ignore[unreachable]
553552
config_level,
554553
ValueError(f"Invalid configuration level:{config_level!r}"),

‎git/util.py

Lines changed: 0 additions & 2 deletions
Original file line numberDiff line numberDiff line change
@@ -1083,7 +1083,6 @@ def __getattr__(self, attr: str) -> T_IterableObj:
10831083
returnlist.__getattribute__(self,attr)
10841084

10851085
def__getitem__(self,index:Union[SupportsIndex,int,slice,str])->T_IterableObj:# type: ignore
1086-
10871086
assertisinstance(index, (int,str,slice)),"Index of IterableList should be an int or str"
10881087

10891088
ifisinstance(index,int):
@@ -1098,7 +1097,6 @@ def __getitem__(self, index: Union[SupportsIndex, int, slice, str]) -> T_Iterabl
10981097
# END handle getattr
10991098

11001099
def__delitem__(self,index:Union[SupportsIndex,int,slice,str])->None:
1101-
11021100
assertisinstance(index, (int,str)),"Index of IterableList should be an int or str"
11031101

11041102
delindex=cast(int,index)

‎pyproject.toml

Lines changed: 1 addition & 0 deletions
Original file line numberDiff line numberDiff line change
@@ -45,3 +45,4 @@ omit = ["*/git/ext/*"]
4545
[tool.black]
4646
line-length =120
4747
target-version = ['py37']
48+
exclude ="git/ext/gitdb"

0 commit comments

Comments
 (0)

[8]ページ先頭

©2009-2025 Movatter.jp