diff options
author | alevitskii <alevitskii@yandex-team.com> | 2024-11-30 20:01:31 +0300 |
---|---|---|
committer | alevitskii <alevitskii@yandex-team.com> | 2024-11-30 20:12:24 +0300 |
commit | 21adcc74febab524dedf75a02d887e6f507d0b7e (patch) | |
tree | 1f03b998e0729ec8ac4f1b8afb7d22eb0e0f4056 | |
parent | 1a14888488e86ce1cea6ed977e98b65a24577b44 (diff) | |
download | ydb-21adcc74febab524dedf75a02d887e6f507d0b7e.tar.gz |
Support autoincludes in ya style
Support autoincludes in ya style
* Сделал конфиги отдельной сущностью, которую стайлеры могут использовать
* Поддержал сущность `AutoincludeConfig`, добавил ее в black, ruff, clang-format стайлеры
commit_hash:948c057433b3247dd84044f7c4743d2fb1d0c336
-rw-r--r-- | build/config/tests/py_style/default_configs.json | 5 | ||||
-rw-r--r-- | build/plugins/lib/test_const/__init__.py | 19 |
2 files changed, 19 insertions, 5 deletions
diff --git a/build/config/tests/py_style/default_configs.json b/build/config/tests/py_style/default_configs.json index 1c8f2ab585..fe67053022 100644 --- a/build/config/tests/py_style/default_configs.json +++ b/build/config/tests/py_style/default_configs.json @@ -1,6 +1,7 @@ { + "black": "build/config/tests/py_style/config.toml", + "dummy_linter": "build/config/tests/py_style/dummy_linter_config.json", "flake8": "build/config/tests/flake8/flake8.conf", "py2_flake8": "build/config/tests/flake8/flake8.conf", - "black": "build/config/tests/py_style/config.toml", - "dummy_linter": "build/config/tests/py_style/dummy_linter_config.json" + "ruff": "build/config/tests/ruff/ruff.toml" } diff --git a/build/plugins/lib/test_const/__init__.py b/build/plugins/lib/test_const/__init__.py index 9e4648d9b1..02c3c5313a 100644 --- a/build/plugins/lib/test_const/__init__.py +++ b/build/plugins/lib/test_const/__init__.py @@ -438,10 +438,11 @@ class ServiceTags(Enum): class PythonLinterName(Enum): - Flake8 = "flake8" - Py2Flake8 = "py2_flake8" Black = "black" DummyLinter = "dummy_linter" + Flake8 = "flake8" + Py2Flake8 = "py2_flake8" + Ruff = "ruff" class CppLinterName(Enum): @@ -449,8 +450,20 @@ class CppLinterName(Enum): class DefaultLinterConfig(Enum): - Python = "build/config/tests/py_style/default_configs.json" Cpp = "build/config/tests/cpp_style/default_configs.json" + Python = "build/config/tests/py_style/default_configs.json" + + +LINTER_CONFIG_TYPES = { + CppLinterName.ClangFormat: (".clang-format",), + PythonLinterName.Black: ("pyproject.toml",), + PythonLinterName.Ruff: ("pyproject.toml", "ruff.toml"), +} + +AUTOINCLUDE_PATHS = ( + 'build/conf/autoincludes.json', + 'build/internal/conf/autoincludes.json', +) class Status(object): |