summaryrefslogtreecommitdiffstats
diff options
context:
space:
mode:
authoralevitskii <[email protected]>2025-03-27 07:25:26 +0300
committeralevitskii <[email protected]>2025-03-27 07:40:50 +0300
commit6f57592a3b6099c881ca20f5b54520a3852a1d56 (patch)
tree54b899cc8c8a1cf2d1957b688b441e7b197bcffd
parent49af5333f4d5d6a10e2ed0a5b8853f2a04540f8a (diff)
Add config validator check
Add config validator check commit_hash:7647a5f2728e1ce2136243e6b362447d8f691268
-rw-r--r--build/plugins/lib/test_const/__init__.py25
1 files changed, 25 insertions, 0 deletions
diff --git a/build/plugins/lib/test_const/__init__.py b/build/plugins/lib/test_const/__init__.py
index 95ecfcbf697..3fd88c7d7c7 100644
--- a/build/plugins/lib/test_const/__init__.py
+++ b/build/plugins/lib/test_const/__init__.py
@@ -438,6 +438,12 @@ class ServiceTags(Enum):
AnyTag = "ya:anytag"
+# NOTE: Linter constants are used in ya style, ya ide, config validator check (devtools/ya/handlers/style/config_validator).
+# ya and validator have different release cycles, make sure you preserve compatibility:
+# - don't delete anything from here until you get rid of all usages and roll out the changes;
+# - keep in mind that changes of constants used in multiple tools may get to production at different times;
+
+
# Linter names must match `NAME` set in `_ADD_*_LINTER_CHECK`
class PythonLinterName(Enum):
Black = "black"
@@ -464,6 +470,22 @@ class LinterConfigsValidationRules(Enum):
Python = "build/config/tests/py_style/configs_validation_rules.json"
+# XXX: if a new linter is added to this mapping respective path to rules file must be available in the json
+LINTER_TO_DEFAULT_CONFIGS = {
+ CppLinterName.ClangFormat: DefaultLinterConfig.Cpp,
+ PythonLinterName.Black: DefaultLinterConfig.Python,
+ PythonLinterName.Ruff: DefaultLinterConfig.Python,
+}
+
+# Fill up like
+"""
+{
+ PythonLinterName.Ruff: LinterConfigsValidationRules.Python,
+}
+"""
+# XXX: if a new linter is added to this mapping respective path to rules file must be available in the json
+LINTER_TO_VALIDATION_CONFIGS = {}
+
LINTER_CONFIG_TYPES = {
CppLinterName.ClangFormat: (".clang-format",),
CppLinterName.ClangFormat15: (".clang-format",),
@@ -479,6 +501,9 @@ AUTOINCLUDE_PATHS = (
)
+# End of linter constants
+
+
class Status(object):
GOOD, XFAIL, FAIL, XPASS, MISSING, CRASHED, TIMEOUT = range(1, 8)
SKIPPED = -100