diff options
author | mikhnenko <mikhnenko@yandex-team.com> | 2024-04-04 16:39:17 +0300 |
---|---|---|
committer | mikhnenko <mikhnenko@yandex-team.com> | 2024-04-04 16:49:35 +0300 |
commit | d3b7159d4281e3d6d92f39a0e2ff7833e68a86d4 (patch) | |
tree | 1e2067a3d91cf63fc6aeca15857bc3e9898bef3c /library | |
parent | f4eb30af3b98eaf6ee9a0900b4160adb653a3eaa (diff) | |
download | ydb-d3b7159d4281e3d6d92f39a0e2ff7833e68a86d4.tar.gz |
Use same configs in ya style and style-tests
853c2293128f6f534d97c1a5c97204e1f72868cf
Diffstat (limited to 'library')
-rw-r--r-- | library/python/cpp_test/test_cpp.py | 12 |
1 files changed, 4 insertions, 8 deletions
diff --git a/library/python/cpp_test/test_cpp.py b/library/python/cpp_test/test_cpp.py index efa10ea283..b4c78f8271 100644 --- a/library/python/cpp_test/test_cpp.py +++ b/library/python/cpp_test/test_cpp.py @@ -10,20 +10,16 @@ from library.python.testing.style import rules import library.python.resource as lpr -STYLE_CONFIG_JSON_14 = json.dumps(yaml.safe_load(lpr.find('resfs/file/config.clang-format'))) -STYLE_CONFIG_JSON_16 = json.dumps(yaml.safe_load(lpr.find('resfs/file/config.clang-format-16'))) +# keep in sync with the logic in https://a.yandex-team.ru/arcadia/devtools/ya/handlers/style/cpp_style.py?rev=r12543375#L21 +STYLE_CONFIG_JSON = json.dumps(yaml.safe_load(lpr.find('resfs/file/config.clang-format'))) RES_FILE_PREFIX = '/cpp_style/files/' CHECKED_PATHS = list(lpr.iterkeys(RES_FILE_PREFIX, strip_prefix=True)) def check_style(filename, actual_source): - try: - clang_format_binary = yatest.common.binary_path('contrib/libs/clang14/tools/clang-format/clang-format') - config = STYLE_CONFIG_JSON_14 - except Exception: - clang_format_binary = yatest.common.binary_path('contrib/libs/clang16/tools/clang-format/clang-format') - config = STYLE_CONFIG_JSON_16 + clang_format_binary = yatest.common.binary_path('contrib/libs/clang16/tools/clang-format/clang-format') + config = STYLE_CONFIG_JSON command = [clang_format_binary, '-assume-filename=' + filename, '-style=' + config] styled_source = subprocess.check_output(command, input=actual_source) |