Skip to content

Commit 856325f

Browse files
committed
lint: Add lint-qt-translation.py
1 parent 294a018 commit 856325f

File tree

1 file changed

+23
-0
lines changed

1 file changed

+23
-0
lines changed

test/lint/lint-qt-translation.py

Lines changed: 23 additions & 0 deletions
Original file line numberDiff line numberDiff line change
@@ -0,0 +1,23 @@
1+
#!/usr/bin/env python3
2+
#
3+
# Copyright (c) 2023-present The Bitcoin Core developers
4+
# Distributed under the MIT software license, see the accompanying
5+
# file COPYING or https://opensource.org/license/mit/.
6+
#
7+
# Check for leading whitespaces in the translatable strings.
8+
9+
import subprocess
10+
import sys
11+
12+
13+
def main():
14+
tr_strings = subprocess.run(['git', 'grep', '-e', 'tr("[[:space:]]', '--', 'src/qt'], stdout=subprocess.PIPE, text=True).stdout
15+
16+
if tr_strings.strip():
17+
print("Avoid leading whitespaces in:")
18+
print(tr_strings)
19+
sys.exit(1)
20+
21+
22+
if __name__ == "__main__":
23+
main()

0 commit comments

Comments
 (0)