From ea8bb1b57c293ae6b4df14d79104bb6ff40468c2 Mon Sep 17 00:00:00 2001 From: =?UTF-8?q?Cristi=C3=A1n=20Maureira-Fredes?= Date: Tue, 28 Jun 2022 16:13:55 +0200 Subject: fix flake8 warnings from gitfunctions.py Change-Id: I3ad241034312b21298b13238d3b1dc97661f0ac9 Reviewed-by: Edward Welbourne Reviewed-by: David Skoland --- scripts/api-review/fullrun/gitfunctions.py | 11 ++++++----- 1 file changed, 6 insertions(+), 5 deletions(-) (limited to 'scripts/api-review/fullrun/gitfunctions.py') 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(): -- cgit v1.2.1