diff options
author | zhukoff-pavel <zhukoff-pavel@yandex-team.com> | 2024-06-25 12:54:44 +0300 |
---|---|---|
committer | zhukoff-pavel <zhukoff-pavel@yandex-team.com> | 2024-06-25 13:11:45 +0300 |
commit | d9e4fe8aeca226856d2780ca903622285610658e (patch) | |
tree | 259936476c64b9543921e56d336deca2e15ad36e /build/plugins/ytest.py | |
parent | e166004e08f4ea69899364beaae07218fc351e95 (diff) | |
download | ydb-d9e4fe8aeca226856d2780ca903622285610658e.tar.gz |
[build/plugins] Allow subdirectories to specify their own clang-tidy config
e4aae7e4d0c4ad8a0023dfdda9a0086c45ea19db
Diffstat (limited to 'build/plugins/ytest.py')
-rw-r--r-- | build/plugins/ytest.py | 11 |
1 files changed, 8 insertions, 3 deletions
diff --git a/build/plugins/ytest.py b/build/plugins/ytest.py index d7b47b69af..04ad1bd4bc 100644 --- a/build/plugins/ytest.py +++ b/build/plugins/ytest.py @@ -431,10 +431,15 @@ def get_tidy_config_map(unit, map_path): return config_map +def prepare_config_map(config_map): + return list(reversed(sorted(config_map.items()))) + + def get_default_tidy_config(unit): unit_path = _common.get_norm_unit_path(unit) - tidy_default_config_map = get_tidy_config_map(unit, DEFAULT_TIDY_CONFIG_MAP_PATH) - for project_prefix, config_path in tidy_default_config_map.items(): + tidy_default_config_map = prepare_config_map(get_tidy_config_map(unit, DEFAULT_TIDY_CONFIG_MAP_PATH)) + + for project_prefix, config_path in tidy_default_config_map: if unit_path.startswith(project_prefix): return config_path return DEFAULT_TIDY_CONFIG @@ -446,7 +451,7 @@ ordered_tidy_map = None def get_project_tidy_config(unit): global ordered_tidy_map if ordered_tidy_map is None: - ordered_tidy_map = list(reversed(sorted(get_tidy_config_map(unit, PROJECT_TIDY_CONFIG_MAP_PATH).items()))) + ordered_tidy_map = prepare_config_map(get_tidy_config_map(unit, PROJECT_TIDY_CONFIG_MAP_PATH)) unit_path = _common.get_norm_unit_path(unit) for project_prefix, config_path in ordered_tidy_map: |