Skip to content

Commit 2513499

Browse files
committed
Merge bitcoin/bitcoin#24803: lint: convert submodule linter test to Python
4a9e36d lint: convert submodule linter test to Python (Eunoia) Pull request description: Refs #24783 ACKs for top commit: laanwj: Tested ACK 4a9e36d Tree-SHA512: ca25b59acf75cebc79588a6c51dc5c313c8d0bd1d492127815d7b81b36aaffd02815a515d97b355582002f71efc33d46435d0b28fce24497bb99799d9ba57228
2 parents 43bb106 + 4a9e36d commit 2513499

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)