diff options
| author | snermolaev <[email protected]> | 2025-06-20 09:35:18 +0300 |
|---|---|---|
| committer | snermolaev <[email protected]> | 2025-06-20 10:06:37 +0300 |
| commit | 8326a6a27716a434a078af28de045e9b2f2dbbda (patch) | |
| tree | cfcfa30c554642118dd3184b262041a09a90ae51 /build/scripts/clang_tidy_arch.py | |
| parent | 5fb942822194a359ab70e9e16783aefb9e59d314 (diff) | |
add info about a file being processed in case of exception
commit_hash:ae7d1ce9430fae6cfb796a95aeae7cba2e0a7021
Diffstat (limited to 'build/scripts/clang_tidy_arch.py')
| -rw-r--r-- | build/scripts/clang_tidy_arch.py | 15 |
1 files changed, 9 insertions, 6 deletions
diff --git a/build/scripts/clang_tidy_arch.py b/build/scripts/clang_tidy_arch.py index 7caf623a3d8..cfceffef82b 100644 --- a/build/scripts/clang_tidy_arch.py +++ b/build/scripts/clang_tidy_arch.py @@ -1,13 +1,12 @@ -import os import argparse import json +import os +import sys def parse_args(): parser = argparse.ArgumentParser() parser.add_argument("--output-file") - parser.add_argument("--build-root") - parser.add_argument("--source-root") return parser.parse_known_args() @@ -16,14 +15,18 @@ def main(): inputs = unknown_args result_json = {} for inp in inputs: - if os.path.exists(inp) and inp.endswith("tidyjson"): + if os.path.exists(inp) and inp.endswith(".tidyjson"): with open(inp, 'r') as afile: file_content = afile.read().strip() if not file_content: continue + try: errors = json.loads(file_content) - testing_src = errors["file"] - result_json[testing_src] = errors + testing_src = errors["file"] + result_json[testing_src] = errors + except Exception as e: + print(f'Exception caught during processing of file {inp}\n', file=sys.stderr) + raise with open(args.output_file, 'w') as afile: json.dump(result_json, afile, indent=4) # TODO remove indent |
