From 1222a9b4c7f2a7e425fd3cfc1919e9c8a73e9c83 Mon Sep 17 00:00:00 2001 From: Hans-Christoph Steiner Date: Tue, 2 May 2017 20:50:01 +0200 Subject: [PATCH] tools: allow check-string-format to be called from anywhere --- .gitlab-ci.yml | 4 +--- app/tools/check-string-format.py | 4 +++- 2 files changed, 4 insertions(+), 4 deletions(-) diff --git a/.gitlab-ci.yml b/.gitlab-ci.yml index 0c3174062..23e1f7776 100644 --- a/.gitlab-ci.yml +++ b/.gitlab-ci.yml @@ -12,9 +12,7 @@ before_script: test: script: - - cd app - - ./tools/check-string-format.py - - cd .. + - ./app/tools/check-string-format.py - ./gradlew assemble -PdisablePreDex # always report on lint errors to the build log - sed -i -e 's,textReport .*,textReport true,' app/build.gradle diff --git a/app/tools/check-string-format.py b/app/tools/check-string-format.py index 625fcfb82..dcb4cadef 100755 --- a/app/tools/check-string-format.py +++ b/app/tools/check-string-format.py @@ -12,9 +12,11 @@ formatRe = re.compile(r'(%%|%[^%](\$.)?)') validFormatRe = re.compile(r'^(%%|%[sd]|%[0-9]\$[sd])$') +projectdir = os.path.join(os.path.dirname(__file__), '..') + count = 0 -for d in glob.glob(os.path.join('src', 'main', 'res', 'values-*')): +for d in sorted(glob.glob(os.path.join(projectdir, 'src', 'main', 'res', 'values-*'))): str_path = os.path.join(d, 'strings.xml') if not os.path.exists(str_path):