Skip to content

Commit d207074

Browse files
authored
Merge pull request #1331 from JohnVillalovos/jlvillal/mypy_config
chore: add type-hints to gitlab/config.py
2 parents 665c0c3 + 213e563 commit d207074

File tree

1 file changed

+7
-4
lines changed

1 file changed

+7
-4
lines changed

gitlab/config.py

+7-4
Original file line numberDiff line numberDiff line change
@@ -17,17 +17,18 @@
1717

1818
import os
1919
import configparser
20+
from typing import List, Optional, Union
2021

2122
from gitlab.const import USER_AGENT
2223

2324

24-
def _env_config():
25+
def _env_config() -> List[str]:
2526
if "PYTHON_GITLAB_CFG" in os.environ:
2627
return [os.environ["PYTHON_GITLAB_CFG"]]
2728
return []
2829

2930

30-
_DEFAULT_FILES = _env_config() + [
31+
_DEFAULT_FILES: List[str] = _env_config() + [
3132
"/etc/python-gitlab.cfg",
3233
os.path.expanduser("~/.python-gitlab.cfg"),
3334
]
@@ -50,7 +51,9 @@ class GitlabConfigMissingError(ConfigError):
5051

5152

5253
class GitlabConfigParser(object):
53-
def __init__(self, gitlab_id=None, config_files=None):
54+
def __init__(
55+
self, gitlab_id: Optional[str] = None, config_files: Optional[List[str]] = None
56+
) -> None:
5457
self.gitlab_id = gitlab_id
5558
_files = config_files or _DEFAULT_FILES
5659
file_exist = False
@@ -85,7 +88,7 @@ def __init__(self, gitlab_id=None, config_files=None):
8588
"configuration (%s)" % self.gitlab_id
8689
) from e
8790

88-
self.ssl_verify = True
91+
self.ssl_verify: Union[bool, str] = True
8992
try:
9093
self.ssl_verify = self._config.getboolean("global", "ssl_verify")
9194
except ValueError:

0 commit comments

Comments
 (0)