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

Appearance settings

Commit 80aadaf

Browse filesBrowse files
chore: enable pylint check: "no-self-use"
Enable the pylint check "no-self-use" and fix the errors detected.
1 parent d0b0811 commit 80aadaf
Copy full SHA for 80aadaf

File tree

Expand file treeCollapse file tree

4 files changed

+17
-11
lines changed
Open diff view settings
Filter options
Expand file treeCollapse file tree

4 files changed

+17
-11
lines changed
Open diff view settings
Collapse file

‎gitlab/client.py‎

Copy file name to clipboardExpand all lines: gitlab/client.py
+7-4Lines changed: 7 additions & 4 deletions
Original file line numberDiff line numberDiff line change
@@ -515,7 +515,8 @@ def _set_auth_info(self) -> None:
515515
self.http_username, self.http_password
516516
)
517517

518-
def enable_debug(self) -> None:
518+
@staticmethod
519+
def enable_debug() -> None:
519520
import logging
520521
from http.client import HTTPConnection # noqa
521522

@@ -534,7 +535,8 @@ def _get_session_opts(self) -> Dict[str, Any]:
534535
"verify": self.ssl_verify,
535536
}
536537

537-
def _get_base_url(self, url: Optional[str] = None) -> str:
538+
@staticmethod
539+
def _get_base_url(url: Optional[str] = None) -> str:
538540
"""Return the base URL with the trailing slash stripped.
539541
If the URL is a Falsy value, return the default URL.
540542
Returns:
@@ -558,7 +560,8 @@ def _build_url(self, path: str) -> str:
558560
return path
559561
return f"{self._url}{path}"
560562

561-
def _check_redirects(self, result: requests.Response) -> None:
563+
@staticmethod
564+
def _check_redirects(result: requests.Response) -> None:
562565
# Check the requests history to detect 301/302 redirections.
563566
# If the initial verb is POST or PUT, the redirected request will use a
564567
# GET request, leading to unwanted behaviour.
@@ -583,8 +586,8 @@ def _check_redirects(self, result: requests.Response) -> None:
583586
)
584587
)
585588

589+
@staticmethod
586590
def _prepare_send_data(
587-
self,
588591
files: Optional[Dict[str, Any]] = None,
589592
post_data: Optional[Union[Dict[str, Any], bytes]] = None,
590593
raw: bool = False,
Collapse file

‎gitlab/types.py‎

Copy file name to clipboardExpand all lines: gitlab/types.py
+4-2Lines changed: 4 additions & 2 deletions
Original file line numberDiff line numberDiff line change
@@ -103,10 +103,12 @@ def get_for_api(self) -> str:
103103

104104

105105
class FileAttribute(GitlabAttribute):
106-
def get_file_name(self, attr_name: Optional[str] = None) -> Optional[str]:
106+
@staticmethod
107+
def get_file_name(attr_name: Optional[str] = None) -> Optional[str]:
107108
return attr_name
108109

109110

110111
class ImageAttribute(FileAttribute):
111-
def get_file_name(self, attr_name: Optional[str] = None) -> str:
112+
@staticmethod
113+
def get_file_name(attr_name: Optional[str] = None) -> str:
112114
return f"{attr_name}.png" if attr_name else "image.png"
Collapse file

‎gitlab/v4/cli.py‎

Copy file name to clipboardExpand all lines: gitlab/v4/cli.py
+6-4Lines changed: 6 additions & 4 deletions
Original file line numberDiff line numberDiff line change
@@ -371,13 +371,14 @@ def get_dict(
371371

372372

373373
class JSONPrinter:
374-
def display(self, d: Union[str, Dict[str, Any]], **kwargs: Any) -> None:
374+
@staticmethod
375+
def display(d: Union[str, Dict[str, Any]], **kwargs: Any) -> None:
375376
import json # noqa
376377

377378
print(json.dumps(d))
378379

380+
@staticmethod
379381
def display_list(
380-
self,
381382
data: List[Union[str, gitlab.base.RESTObject]],
382383
fields: List[str],
383384
**kwargs: Any,
@@ -388,7 +389,8 @@ def display_list(
388389

389390

390391
class YAMLPrinter:
391-
def display(self, d: Union[str, Dict[str, Any]], **kwargs: Any) -> None:
392+
@staticmethod
393+
def display(d: Union[str, Dict[str, Any]], **kwargs: Any) -> None:
392394
try:
393395
import yaml # noqa
394396

@@ -400,8 +402,8 @@ def display(self, d: Union[str, Dict[str, Any]], **kwargs: Any) -> None:
400402
"to use the yaml output feature"
401403
)
402404

405+
@staticmethod
403406
def display_list(
404-
self,
405407
data: List[Union[str, gitlab.base.RESTObject]],
406408
fields: List[str],
407409
**kwargs: Any,
Collapse file

‎pyproject.toml‎

Copy file name to clipboardExpand all lines: pyproject.toml
-1Lines changed: 0 additions & 1 deletion
Original file line numberDiff line numberDiff line change
@@ -57,7 +57,6 @@ disable = [
5757
"missing-class-docstring",
5858
"missing-function-docstring",
5959
"missing-module-docstring",
60-
"no-self-use",
6160
"protected-access",
6261
"redefined-builtin",
6362
"redefined-outer-name",

0 commit comments

Comments
0 (0)
Morty Proxy This is a proxified and sanitized view of the page, visit original site.