diff options
author | AlexSm <alex@ydb.tech> | 2024-01-11 14:49:03 +0100 |
---|---|---|
committer | GitHub <noreply@github.com> | 2024-01-11 14:49:03 +0100 |
commit | 2e180154bd6a38b90a128ba0463d0dd2706a5ccf (patch) | |
tree | 0e0890fa08e63af33c52c9b6eacee56d037a740b /build/scripts/clang_static_analyzer.py | |
parent | 4366d88bef9360d9754e77eaa1f4a25d046a9cbd (diff) | |
download | ydb-2e180154bd6a38b90a128ba0463d0dd2706a5ccf.tar.gz |
Library import 7 (#937)
Diffstat (limited to 'build/scripts/clang_static_analyzer.py')
-rw-r--r-- | build/scripts/clang_static_analyzer.py | 10 |
1 files changed, 7 insertions, 3 deletions
diff --git a/build/scripts/clang_static_analyzer.py b/build/scripts/clang_static_analyzer.py index 65df8816af..128d45fdad 100644 --- a/build/scripts/clang_static_analyzer.py +++ b/build/scripts/clang_static_analyzer.py @@ -3,9 +3,9 @@ import sys import os import re import argparse -import yaml +import json -CLANG_SA_CONFIG='static_analyzer.yaml' +CLANG_SA_CONFIG='static_analyzer.json' def parse_args(): parser = argparse.ArgumentParser() @@ -31,7 +31,7 @@ def parse_config(config_file): conf = None try: with open(config_file, 'r') as afile: - conf = yaml.safe_load(afile) + conf = json.load(afile) except: conf = None return conf @@ -61,6 +61,10 @@ def main(): config_file = find_config(args.config_file) conf = parse_config(config_file) + # Ensure we can read config + if not conf: + raise ValueError(f"Cant parse config file, check its syntax: {config_file}") + # Ensure we have at least one check if ('checks' not in conf) or (not conf['checks']): raise ValueError("There are no checks in the config file") |