/ test / lint / lint-submodule.py
lint-submodule.py
 1  #!/usr/bin/env python3
 2  #
 3  # Copyright (c) 2022-present 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                                                  text = True).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()