summaryrefslogtreecommitdiff
path: root/mesonbuild/scripts/vcstagger.py
diff options
context:
space:
mode:
authorDaniel Mensinger <daniel@mensinger-ka.de>2020-08-29 21:23:43 +0200
committerDaniel Mensinger <daniel@mensinger-ka.de>2020-09-08 20:15:56 +0200
commita4f4379c44c7f13bc9e44bc01504077af1f3a338 (patch)
tree6f969b023a4311c7bad7b1dbdd61fa845cadfef3 /mesonbuild/scripts/vcstagger.py
parent0d57e307b2fea541a9ee368873431fe224e5c982 (diff)
downloadmeson-a4f4379c44c7f13bc9e44bc01504077af1f3a338.tar.gz
typing: fully annotate scripts
Diffstat (limited to 'mesonbuild/scripts/vcstagger.py')
-rw-r--r--mesonbuild/scripts/vcstagger.py6
1 files changed, 3 insertions, 3 deletions
diff --git a/mesonbuild/scripts/vcstagger.py b/mesonbuild/scripts/vcstagger.py
index 16dd4d1e5..64985f6d3 100644
--- a/mesonbuild/scripts/vcstagger.py
+++ b/mesonbuild/scripts/vcstagger.py
@@ -13,9 +13,9 @@
# limitations under the License.
import sys, os, subprocess, re
+import typing as T
-
-def config_vcs_tag(infile, outfile, fallback, source_dir, replace_string, regex_selector, cmd):
+def config_vcs_tag(infile: str, outfile: str, fallback: str, source_dir: str, replace_string: str, regex_selector: str, cmd: T.List[str]) -> None:
try:
output = subprocess.check_output(cmd, cwd=source_dir)
new_string = re.search(regex_selector, output.decode()).group(1).strip()
@@ -34,7 +34,7 @@ def config_vcs_tag(infile, outfile, fallback, source_dir, replace_string, regex_
f.write(new_data)
-def run(args):
+def run(args: T.List[str]) -> int:
infile, outfile, fallback, source_dir, replace_string, regex_selector = args[0:6]
command = args[6:]
config_vcs_tag(infile, outfile, fallback, source_dir, replace_string, regex_selector, command)