diff --git a/misc/scripts/check-query-ids.py b/misc/scripts/check-query-ids.py old mode 100644 new mode 100755 index aa06ae3a6a59..4158b992ec7c --- a/misc/scripts/check-query-ids.py +++ b/misc/scripts/check-query-ids.py @@ -1,3 +1,5 @@ +#!/usr/bin/env python3 + from pathlib import Path import re import sys diff --git a/misc/scripts/create-change-note.py b/misc/scripts/create-change-note.py old mode 100644 new mode 100755 diff --git a/misc/scripts/generate-code-scanning-query-list.py b/misc/scripts/generate-code-scanning-query-list.py old mode 100644 new mode 100755 index 94b15a33886d..72a5d7732d00 --- a/misc/scripts/generate-code-scanning-query-list.py +++ b/misc/scripts/generate-code-scanning-query-list.py @@ -1,3 +1,5 @@ +#!/usr/bin/env python3 + import subprocess import json import csv @@ -52,7 +54,7 @@ def __exit__(self, type, value, tb): except: self.proc.kill() - def command(self, args): + def command(self, args): data = json.dumps(args) data_bytes = data.encode('utf-8') self.proc.stdin.write(data_bytes) diff --git a/misc/scripts/models-as-data/generate_flow_model.py b/misc/scripts/models-as-data/generate_flow_model.py old mode 100644 new mode 100755 index cfd524066cbf..17db03e01e4f --- a/misc/scripts/models-as-data/generate_flow_model.py +++ b/misc/scripts/models-as-data/generate_flow_model.py @@ -140,7 +140,7 @@ def make(language): generator.setenvironment(sys.argv[1], sys.argv[2]) return generator - + def runQuery(self, query): print("########## Querying " + query + "...") @@ -224,7 +224,7 @@ def run(self): if self.dryRun: print("Models as data extensions generated, but not written to file.") sys.exit(0) - + if (self.generateSinks or self.generateSources or self.generateSummaries or diff --git a/misc/scripts/pre-commit b/misc/scripts/pre-commit old mode 100644 new mode 100755 diff --git a/misc/scripts/shared-code-metrics.py b/misc/scripts/shared-code-metrics.py old mode 100644 new mode 100755 index bfc613e5c877..23ce1fd8759a --- a/misc/scripts/shared-code-metrics.py +++ b/misc/scripts/shared-code-metrics.py @@ -1,7 +1,7 @@ #!/bin/env python3 # Generates a report on the amount of code sharing in this repo # -# The purpose of this is +# The purpose of this is # a) To be able to understand the structure and dependencies # b) To provide a metric that measures the amount of shared vs non-shared code @@ -224,7 +224,7 @@ def calculateDependencies(self, packageNameMap): if lang in language_info: info = language_info[lang] if qlfile.isOnlyInLanguage(lang): - info.addQlFile(qlfile) + info.addQlFile(qlfile) # Determine all package dependencies @@ -276,15 +276,15 @@ def print_package_dependencies(packages): nlines = package.lines + package.total_imported_lines shared_percentage = 100 * package.total_imported_lines / nlines if nlines>0 else 0 print('|', package.link(), '|', package.files, '|', package.lines, '|', package.total_imported_files, '|', package.total_imported_lines, '|', - # ','.join([p.name for p in package.all_dependencies]), + # ','.join([p.name for p in package.all_dependencies]), "%.2f" % shared_percentage, '|') print() def print_language_dependencies(packages): - print_package_dependencies([p for p in packages if p.name.endswith('-all') and p.name.count('-')==1]) + print_package_dependencies([p for p in packages if p.name.endswith('-all') and p.name.count('-')==1]) def list_shared_code_by_language(language_info): - # For each language directory, list the files that are (1) inside the directory and not shared, + # For each language directory, list the files that are (1) inside the directory and not shared, # (2) packages from outside the directory, plus identical files print('| Language | Non-shared files | Non-shared lines of code | Imported files | Imported lines of code | Shared code % |') print('| -------- | ---------------- | ------------------------ | -------------- | ---------------------- | ------------- |')