diff options
author | alexv-smirnov <[email protected]> | 2023-06-13 11:05:01 +0300 |
---|---|---|
committer | alexv-smirnov <[email protected]> | 2023-06-13 11:05:01 +0300 |
commit | bf0f13dd39ee3e65092ba3572bb5b1fcd125dcd0 (patch) | |
tree | 1d1df72c0541a59a81439842f46d95396d3e7189 /build/scripts/clang_tidy_arch.py | |
parent | 8bfdfa9a9bd19bddbc58d888e180fbd1218681be (diff) |
add ymake export to ydb
Diffstat (limited to 'build/scripts/clang_tidy_arch.py')
-rw-r--r-- | build/scripts/clang_tidy_arch.py | 33 |
1 files changed, 33 insertions, 0 deletions
diff --git a/build/scripts/clang_tidy_arch.py b/build/scripts/clang_tidy_arch.py new file mode 100644 index 00000000000..7caf623a3d8 --- /dev/null +++ b/build/scripts/clang_tidy_arch.py @@ -0,0 +1,33 @@ +import os +import argparse +import json + + +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() + + +def main(): + args, unknown_args = parse_args() + inputs = unknown_args + result_json = {} + for inp in inputs: + 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 + errors = json.loads(file_content) + testing_src = errors["file"] + result_json[testing_src] = errors + + with open(args.output_file, 'w') as afile: + json.dump(result_json, afile, indent=4) # TODO remove indent + + +if __name__ == "__main__": + main() |