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

Commit2100aa4

Browse files
JohnVillalovosnejch
authored andcommitted
chore: reformat code with skip_magic_trailing_comma = true
This way now and in the future it will automatically shrink multiplelines as needed.
1 parent4e90c11 commit2100aa4

File tree

102 files changed

+189
-775
lines changed

Some content is hidden

Large Commits have some content hidden by default. Use the searchbox below for content that may be hidden.

102 files changed

+189
-775
lines changed

‎gitlab/base.py

Lines changed: 2 additions & 12 deletions
Original file line numberDiff line numberDiff line change
@@ -7,25 +7,15 @@
77
importtextwrap
88
fromcollections.abcimportIterable
99
fromtypesimportModuleType
10-
fromtypingimport (
11-
Any,
12-
ClassVar,
13-
Generic,
14-
TYPE_CHECKING,
15-
TypeVar,
16-
)
10+
fromtypingimportAny,ClassVar,Generic,TYPE_CHECKING,TypeVar
1711

1812
importgitlab
1913
fromgitlabimporttypesasg_types
2014
fromgitlab.exceptionsimportGitlabParsingError
2115

2216
from .clientimportGitlab,GitlabList
2317

24-
__all__= [
25-
"RESTObject",
26-
"RESTObjectList",
27-
"RESTManager",
28-
]
18+
__all__= ["RESTObject","RESTObjectList","RESTManager"]
2919

3020

3121
_URL_ATTRIBUTE_ERROR= (

‎gitlab/cli.py

Lines changed: 1 addition & 8 deletions
Original file line numberDiff line numberDiff line change
@@ -8,14 +8,7 @@
88
importre
99
importsys
1010
fromtypesimportModuleType
11-
fromtypingimport (
12-
Any,
13-
Callable,
14-
cast,
15-
NoReturn,
16-
TYPE_CHECKING,
17-
TypeVar,
18-
)
11+
fromtypingimportAny,Callable,cast,NoReturn,TYPE_CHECKING,TypeVar
1912

2013
fromrequests.structuresimportCaseInsensitiveDict
2114

‎gitlab/client.py

Lines changed: 7 additions & 25 deletions
Original file line numberDiff line numberDiff line change
@@ -4,12 +4,7 @@
44

55
importos
66
importre
7-
fromtypingimport (
8-
Any,
9-
BinaryIO,
10-
cast,
11-
TYPE_CHECKING,
12-
)
7+
fromtypingimportAny,BinaryIO,cast,TYPE_CHECKING
138
fromurllibimportparse
149

1510
importrequests
@@ -952,11 +947,7 @@ def should_emit_warning() -> bool:
952947
f"`get_all=False` to the `list()` call."
953948
)
954949
show_caller=True
955-
utils.warn(
956-
message=message,
957-
category=UserWarning,
958-
show_caller=show_caller,
959-
)
950+
utils.warn(message=message,category=UserWarning,show_caller=show_caller)
960951
returnitems
961952

962953
defhttp_post(
@@ -1097,12 +1088,7 @@ def http_patch(
10971088
post_data=post_dataor {}
10981089

10991090
result=self.http_request(
1100-
"patch",
1101-
path,
1102-
query_data=query_data,
1103-
post_data=post_data,
1104-
raw=raw,
1105-
**kwargs,
1091+
"patch",path,query_data=query_data,post_data=post_data,raw=raw,**kwargs
11061092
)
11071093
ifresult.status_codeingitlab.const.NO_JSON_RESPONSE_CODES:
11081094
returnresult
@@ -1383,13 +1369,11 @@ def execute(self, request: str | graphql.Source, *args: Any, **kwargs: Any) -> A
13831369

13841370
ife.code==401:
13851371
raisegitlab.exceptions.GitlabAuthenticationError(
1386-
response_code=e.code,
1387-
error_message=str(e),
1372+
response_code=e.code,error_message=str(e)
13881373
)
13891374

13901375
raisegitlab.exceptions.GitlabHttpError(
1391-
response_code=e.code,
1392-
error_message=str(e),
1376+
response_code=e.code,error_message=str(e)
13931377
)
13941378

13951379
returnresult
@@ -1459,13 +1443,11 @@ async def execute(
14591443

14601444
ife.code==401:
14611445
raisegitlab.exceptions.GitlabAuthenticationError(
1462-
response_code=e.code,
1463-
error_message=str(e),
1446+
response_code=e.code,error_message=str(e)
14641447
)
14651448

14661449
raisegitlab.exceptions.GitlabHttpError(
1467-
response_code=e.code,
1468-
error_message=str(e),
1450+
response_code=e.code,error_message=str(e)
14691451
)
14701452

14711453
returnresult

‎gitlab/config.py

Lines changed: 1 addition & 3 deletions
Original file line numberDiff line numberDiff line change
@@ -26,9 +26,7 @@ def _resolve_file(filepath: Path | str) -> str:
2626
returnstr(resolved)
2727

2828

29-
def_get_config_files(
30-
config_files:list[str]|None=None,
31-
)->str|list[str]:
29+
def_get_config_files(config_files:list[str]|None=None)->str|list[str]:
3230
"""
3331
Return resolved path(s) to config files if they exist, with precedence:
3432
1. Files passed in config_files

‎gitlab/mixins.py

Lines changed: 3 additions & 13 deletions
Original file line numberDiff line numberDiff line change
@@ -3,13 +3,7 @@
33
importenum
44
fromcollections.abcimportIterator
55
fromtypesimportModuleType
6-
fromtypingimport (
7-
Any,
8-
Callable,
9-
Literal,
10-
overload,
11-
TYPE_CHECKING,
12-
)
6+
fromtypingimportAny,Callable,Literal,overload,TYPE_CHECKING
137

148
importrequests
159

@@ -261,9 +255,7 @@ class UpdateMixin(base.RESTManager[base.TObjCls]):
261255
# Update mixins attrs for easier implementation
262256
_update_method:UpdateMethod=UpdateMethod.PUT
263257

264-
def_get_update_method(
265-
self,
266-
)->Callable[...,dict[str,Any]|requests.Response]:
258+
def_get_update_method(self)->Callable[...,dict[str,Any]|requests.Response]:
267259
"""Return the HTTP method to use.
268260
269261
Returns:
@@ -931,9 +923,7 @@ class PromoteMixin(_RestObjectBase):
931923
_update_method:UpdateMethod=UpdateMethod.PUT
932924
manager:base.RESTManager[Any]
933925

934-
def_get_update_method(
935-
self,
936-
)->Callable[...,dict[str,Any]|requests.Response]:
926+
def_get_update_method(self)->Callable[...,dict[str,Any]|requests.Response]:
937927
"""Return the HTTP method to use.
938928
939929
Returns:

‎gitlab/types.py

Lines changed: 1 addition & 4 deletions
Original file line numberDiff line numberDiff line change
@@ -11,10 +11,7 @@ class RequiredOptional:
1111
exclusive:tuple[str, ...]= ()
1212

1313
defvalidate_attrs(
14-
self,
15-
*,
16-
data:dict[str,Any],
17-
excludes:list[str]|None=None,
14+
self,*,data:dict[str,Any],excludes:list[str]|None=None
1815
)->None:
1916
ifexcludesisNone:
2017
excludes= []

‎gitlab/utils.py

Lines changed: 3 additions & 14 deletions
Original file line numberDiff line numberDiff line change
@@ -9,11 +9,7 @@
99
importurllib.parse
1010
importwarnings
1111
fromcollections.abcimportIterator,MutableMapping
12-
fromtypingimport (
13-
Any,
14-
Callable,
15-
Literal,
16-
)
12+
fromtypingimportAny,Callable,Literal
1713

1814
importrequests
1915

@@ -208,11 +204,7 @@ def _transform_types(
208204
returndata,files
209205

210206

211-
defcopy_dict(
212-
*,
213-
src:dict[str,Any],
214-
dest:dict[str,Any],
215-
)->None:
207+
defcopy_dict(*,src:dict[str,Any],dest:dict[str,Any])->None:
216208
fork,vinsrc.items():
217209
ifisinstance(v,dict):
218210
# NOTE(jlvillal): This provides some support for the `hash` type
@@ -284,10 +276,7 @@ def warn(
284276
ifshow_caller:
285277
message+=warning_from
286278
warnings.warn(
287-
message=message,
288-
category=category,
289-
stacklevel=stacklevel,
290-
source=source,
279+
message=message,category=category,stacklevel=stacklevel,source=source
291280
)
292281

293282

‎gitlab/v4/cli.py

Lines changed: 4 additions & 10 deletions
Original file line numberDiff line numberDiff line change
@@ -133,9 +133,7 @@ def do_create(self) -> gitlab.base.RESTObject:
133133
cli.die("Impossible to create object",e)
134134
returnresult
135135

136-
defdo_list(
137-
self,
138-
)->gitlab.base.RESTObjectList|list[gitlab.base.RESTObject]:
136+
defdo_list(self)->gitlab.base.RESTObjectList|list[gitlab.base.RESTObject]:
139137
ifTYPE_CHECKING:
140138
assertisinstance(self.mgr,gitlab.mixins.ListMixin)
141139
message_details=gitlab.utils.WarnMessageData(
@@ -210,8 +208,7 @@ def do_update(self) -> dict[str, Any]:
210208

211209

212210
def_populate_sub_parser_by_class(
213-
cls:type[gitlab.base.RESTObject],
214-
sub_parser:_SubparserType,
211+
cls:type[gitlab.base.RESTObject],sub_parser:_SubparserType
215212
)->None:
216213
mgr_cls_name=f"{cls.__name__}Manager"
217214
mgr_cls=getattr(gitlab.v4.objects,mgr_cls_name)
@@ -228,9 +225,7 @@ def _populate_sub_parser_by_class(
228225
continue
229226

230227
sub_parser_action=sub_parser.add_parser(
231-
action_name,
232-
conflict_handler="resolve",
233-
help=help_text,
228+
action_name,conflict_handler="resolve",help=help_text
234229
)
235230
action_parsers[action_name]=sub_parser_action
236231
sub_parser_action.add_argument("--sudo",required=False)
@@ -415,8 +410,7 @@ def extend_parser(parser: argparse.ArgumentParser) -> argparse.ArgumentParser:
415410
mgr_cls_name=f"{cls.__name__}Manager"
416411
mgr_cls=getattr(gitlab.v4.objects,mgr_cls_name)
417412
object_group=subparsers.add_parser(
418-
arg_name,
419-
help=f"API endpoint:{mgr_cls._path}",
413+
arg_name,help=f"API endpoint:{mgr_cls._path}"
420414
)
421415

422416
object_subparsers=object_group.add_subparsers(

‎gitlab/v4/objects/appearance.py

Lines changed: 2 additions & 5 deletions
Original file line numberDiff line numberDiff line change
@@ -7,10 +7,7 @@
77
fromgitlab.mixinsimportGetWithoutIdMixin,SaveMixin,UpdateMixin
88
fromgitlab.typesimportRequiredOptional
99

10-
__all__= [
11-
"ApplicationAppearance",
12-
"ApplicationAppearanceManager",
13-
]
10+
__all__= ["ApplicationAppearance","ApplicationAppearanceManager"]
1411

1512

1613
classApplicationAppearance(SaveMixin,RESTObject):
@@ -35,7 +32,7 @@ class ApplicationAppearanceManager(
3532
"message_background_color",
3633
"message_font_color",
3734
"email_header_and_footer_enabled",
38-
),
35+
)
3936
)
4037

4138
@exc.on_http_error(exc.GitlabUpdateError)

‎gitlab/v4/objects/applications.py

Lines changed: 1 addition & 4 deletions
Original file line numberDiff line numberDiff line change
@@ -2,10 +2,7 @@
22
fromgitlab.mixinsimportCreateMixin,DeleteMixin,ListMixin,ObjectDeleteMixin
33
fromgitlab.typesimportRequiredOptional
44

5-
__all__= [
6-
"Application",
7-
"ApplicationManager",
8-
]
5+
__all__= ["Application","ApplicationManager"]
96

107

118
classApplication(ObjectDeleteMixin,RESTObject):

0 commit comments

Comments
 (0)

[8]ページ先頭

©2009-2025 Movatter.jp