Skip to content

Commit 439311e

Browse files
committed
chores: add more typing information
1 parent d79a3c4 commit 439311e

3 files changed

Lines changed: 9 additions & 9 deletions

File tree

sw360/license.py

Lines changed: 1 addition & 1 deletion
Original file line numberDiff line numberDiff line change
@@ -22,7 +22,7 @@ def create_new_license(
2222
shortName: str,
2323
fullName: str,
2424
text: str,
25-
checked: False,
25+
checked: bool = False,
2626
license_details={},
2727
) -> Any:
2828
"""Create a new component

sw360/project.py

Lines changed: 7 additions & 7 deletions
Original file line numberDiff line numberDiff line change
@@ -1,5 +1,5 @@
11
# -------------------------------------------------------------------------------
2-
# Copyright (c) 2019-2022 Siemens
2+
# Copyright (c) 2019-2023 Siemens
33
# Copyright (c) 2022 BMW CarIT GmbH
44
# All Rights Reserved.
55
# Authors: thomas.graf@siemens.com, gernot.hillier@siemens.com
@@ -63,7 +63,7 @@ def get_project_by_url(self, url):
6363
resp = self.api_get(url)
6464
return resp
6565

66-
def get_projects(self, all_details=False, page=-1, page_size=-1):
66+
def get_projects(self, all_details: bool = False, page: int = -1, page_size: int = -1):
6767
"""Get all projects
6868
6969
API endpoint: GET /projects
@@ -133,7 +133,7 @@ def get_project_names(self):
133133

134134
return resp
135135

136-
def get_projects_by_name(self, name):
136+
def get_projects_by_name(self, name: str):
137137
"""Get a project by its name
138138
139139
API endpoint: GET /projects
@@ -157,7 +157,7 @@ def get_projects_by_name(self, name):
157157
resp = resp["_embedded"]["sw360:projects"]
158158
return resp
159159

160-
def get_projects_by_external_id(self, ext_id_name, ext_id_value=""):
160+
def get_projects_by_external_id(self, ext_id_name: str, ext_id_value: str = ""):
161161
"""Get projects by external id. `ext_id_value` can be left blank to
162162
search for all projects with `ext_id_name`.
163163
@@ -185,7 +185,7 @@ def get_projects_by_external_id(self, ext_id_name, ext_id_value=""):
185185
resp = resp["_embedded"]["sw360:projects"]
186186
return resp
187187

188-
def get_projects_by_group(self, group, all_details=False):
188+
def get_projects_by_group(self, group: str, all_details: bool = False):
189189
"""Get projects by group.
190190
191191
API endpoint: GET /projects?group=
@@ -213,7 +213,7 @@ def get_projects_by_group(self, group, all_details=False):
213213
resp = resp["_embedded"]["sw360:projects"]
214214
return resp
215215

216-
def get_projects_by_tag(self, tag):
216+
def get_projects_by_tag(self, tag: str):
217217
"""Get projects by tag.
218218
219219
API endpoint: GET /projects?tag=
@@ -238,7 +238,7 @@ def get_projects_by_tag(self, tag):
238238
resp = resp["_embedded"]["sw360:projects"]
239239
return resp
240240

241-
def get_project_vulnerabilities(self, project_id):
241+
def get_project_vulnerabilities(self, project_id: str):
242242
"""Get the security vulnerabilities for the specified project.
243243
244244
API endpoint: GET /projects/id/vulnerabilities

sw360/sw360oauth2.py

Lines changed: 1 addition & 1 deletion
Original file line numberDiff line numberDiff line change
@@ -61,7 +61,7 @@ def __get_credentials(self) -> None:
6161
self._client_id = data["client_id"]
6262
self._client_secret = data["client_secret"]
6363

64-
def create_client(self, description: str, writeable: False) -> None:
64+
def create_client(self, description: str, writeable: bool = False) -> None:
6565
"""Create an OAuth2 client
6666
6767
Args:

0 commit comments

Comments
 (0)