Skip to content

Commit 4a9e36d

Browse files
authored
lint: convert submodule linter test to Python
1 parent 254f3cc commit 4a9e36d

File tree

2 files changed

+23
-20
lines changed

2 files changed

+23
-20
lines changed

test/lint/lint-submodule.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) 2022 The Bitcoin Core developers
4+
# Distributed under the MIT software license, see the accompanying
5+
# file COPYING or http://www.opensource.org/licenses/mit-license.php.
6+
7+
"""
8+
This script checks for git modules
9+
"""
10+
11+
import subprocess
12+
import sys
13+
14+
def main():
15+
submodules_list = subprocess.check_output(['git', 'submodule', 'status', '--recursive'],
16+
universal_newlines = True, encoding = 'utf8').rstrip('\n')
17+
if submodules_list:
18+
print("These submodules were found, delete them:\n", submodules_list)
19+
sys.exit(1)
20+
sys.exit(0)
21+
22+
if __name__ == '__main__':
23+
main()

test/lint/lint-submodule.sh

Lines changed: 0 additions & 20 deletions
This file was deleted.

0 commit comments

Comments
 (0)