metadata: script to delete 0 size files and standardize whitespace

This commit is contained in:
Hans-Christoph Steiner 2019-02-20 15:34:11 +01:00
parent 9897c97ef8
commit 7ce7b46ed2
2 changed files with 16 additions and 0 deletions

View File

@ -43,6 +43,7 @@ test_lint_pmd_checkstyle:
- ./gradlew pmd || export EXITVALUE=1
- ./gradlew checkstyle || export EXITVALUE=1
- ./tools/check-format-strings.py || export EXITVALUE=1
- ./tools/check-fastlane-whitespace.py || export EXITVALUE=1
- ./tools/remove-unused-and-blank-translations.py || export EXITVALUE=1
- echo "These are unused or blank translations that should be removed:"
- git --no-pager diff --ignore-all-space --name-only --exit-code app/src/*/res/values*/strings.xml || export EXITVALUE=1

View File

@ -0,0 +1,15 @@
#!/usr/bin/env python3
import glob
import os
for f in glob.glob('metadata/*/*.txt') + glob.glob('metadata/*/*/*.txt'):
if os.path.getsize(f) == 0:
os.remove(f)
continue
with open(f) as fp:
data = fp.read()
with open(f, 'w') as fp:
fp.write(data.rstrip())
fp.write('\n')