Skip to content

Commit 2100aa4

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 multiple lines as needed.
1 parent 4e90c11 commit 2100aa4

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
import textwrap
88
from collections.abc import Iterable
99
from types import ModuleType
10-
from typing import (
11-
Any,
12-
ClassVar,
13-
Generic,
14-
TYPE_CHECKING,
15-
TypeVar,
16-
)
10+
from typing import Any, ClassVar, Generic, TYPE_CHECKING, TypeVar
1711

1812
import gitlab
1913
from gitlab import types as g_types
2014
from gitlab.exceptions import GitlabParsingError
2115

2216
from .client import Gitlab, 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
import re
99
import sys
1010
from types import ModuleType
11-
from typing import (
12-
Any,
13-
Callable,
14-
cast,
15-
NoReturn,
16-
TYPE_CHECKING,
17-
TypeVar,
18-
)
11+
from typing import Any, Callable, cast, NoReturn, TYPE_CHECKING, TypeVar
1912

2013
from requests.structures import CaseInsensitiveDict
2114

gitlab/client.py

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

55
import os
66
import re
7-
from typing import (
8-
Any,
9-
BinaryIO,
10-
cast,
11-
TYPE_CHECKING,
12-
)
7+
from typing import Any, BinaryIO, cast, TYPE_CHECKING
138
from urllib import parse
149

1510
import requests
@@ -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
return items
961952

962953
def http_post(
@@ -1097,12 +1088,7 @@ def http_patch(
10971088
post_data = post_data or {}
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
if result.status_code in gitlab.const.NO_JSON_RESPONSE_CODES:
11081094
return result
@@ -1383,13 +1369,11 @@ def execute(self, request: str | graphql.Source, *args: Any, **kwargs: Any) -> A
13831369

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

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

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

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

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

14711453
return result

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
return str(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
import enum
44
from collections.abc import Iterator
55
from types import ModuleType
6-
from typing import (
7-
Any,
8-
Callable,
9-
Literal,
10-
overload,
11-
TYPE_CHECKING,
12-
)
6+
from typing import Any, Callable, Literal, overload, TYPE_CHECKING
137

148
import requests
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
def validate_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
if excludes is None:
2017
excludes = []

gitlab/utils.py

Lines changed: 3 additions & 14 deletions
Original file line numberDiff line numberDiff line change
@@ -9,11 +9,7 @@
99
import urllib.parse
1010
import warnings
1111
from collections.abc import Iterator, MutableMapping
12-
from typing import (
13-
Any,
14-
Callable,
15-
Literal,
16-
)
12+
from typing import Any, Callable, Literal
1713

1814
import requests
1915

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

210206

211-
def copy_dict(
212-
*,
213-
src: dict[str, Any],
214-
dest: dict[str, Any],
215-
) -> None:
207+
def copy_dict(*, src: dict[str, Any], dest: dict[str, Any]) -> None:
216208
for k, v in src.items():
217209
if isinstance(v, dict):
218210
# NOTE(jlvillal): This provides some support for the `hash` type
@@ -284,10 +276,7 @@ def warn(
284276
if show_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
return result
135135

136-
def do_list(
137-
self,
138-
) -> gitlab.base.RESTObjectList | list[gitlab.base.RESTObject]:
136+
def do_list(self) -> gitlab.base.RESTObjectList | list[gitlab.base.RESTObject]:
139137
if TYPE_CHECKING:
140138
assert isinstance(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
from gitlab.mixins import GetWithoutIdMixin, SaveMixin, UpdateMixin
88
from gitlab.types import RequiredOptional
99

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

1512

1613
class ApplicationAppearance(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
from gitlab.mixins import CreateMixin, DeleteMixin, ListMixin, ObjectDeleteMixin
33
from gitlab.types import RequiredOptional
44

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

107

118
class Application(ObjectDeleteMixin, RESTObject):

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