summaryrefslogtreecommitdiff
path: root/scripts/api-review/fullrun/gitfunctions.py
diff options
context:
space:
mode:
authorCristián Maureira-Fredes <Cristian.Maureira-Fredes@qt.io>2022-06-28 16:13:55 +0200
committerCristián Maureira-Fredes <Cristian.Maureira-Fredes@qt.io>2023-01-11 13:37:55 +0200
commitea8bb1b57c293ae6b4df14d79104bb6ff40468c2 (patch)
tree174088508343a1941594c736fbc61b21f2fad675 /scripts/api-review/fullrun/gitfunctions.py
parentb4d83ec8c24233da0b3f77e9cf05649c71e66974 (diff)
downloadqtqa-ea8bb1b57c293ae6b4df14d79104bb6ff40468c2.tar.gz
fix flake8 warnings from gitfunctions.py
Change-Id: I3ad241034312b21298b13238d3b1dc97661f0ac9 Reviewed-by: Edward Welbourne <edward.welbourne@qt.io> Reviewed-by: David Skoland <davidskoland@gmail.com>
Diffstat (limited to 'scripts/api-review/fullrun/gitfunctions.py')
-rw-r--r--scripts/api-review/fullrun/gitfunctions.py11
1 files changed, 6 insertions, 5 deletions
diff --git a/scripts/api-review/fullrun/gitfunctions.py b/scripts/api-review/fullrun/gitfunctions.py
index 73adfb2..89b5c59 100644
--- a/scripts/api-review/fullrun/gitfunctions.py
+++ b/scripts/api-review/fullrun/gitfunctions.py
@@ -7,8 +7,9 @@
import os
import subprocess
+
# get the current branch of git repo
-def get_branch(git_repo : str = '.') -> str:
+def get_branch(git_repo: str = '.') -> str:
cwd = os.getcwd()
os.chdir(git_repo)
@@ -17,15 +18,14 @@ def get_branch(git_repo : str = '.') -> str:
completed_process = subprocess.run(cmd, capture_output=True)
output = completed_process.stdout.decode('utf-8').strip()
- #print(output)
-
os.chdir(cwd)
return output
+
# Gets a list of submodules from given git repo path and optionally, branch
# Where each module is represented by a dict
-def get_submodules(git_repo : str = '.', branch : str = 'current') -> {}:
+def get_submodules(git_repo: str = '.', branch: str = 'current') -> {}:
cwd = os.getcwd()
os.chdir(git_repo)
@@ -71,8 +71,9 @@ def get_submodules(git_repo : str = '.', branch : str = 'current') -> {}:
return modules
+
# Returns a list of active submodules for the given repo and branch
-def get_active_submodules(git_repo : str = '.', branch : str = 'current') -> []:
+def get_active_submodules(git_repo: str = '.', branch: str = 'current') -> []:
modules = []
for module_name, module in get_submodules(git_repo, branch).items():