summaryrefslogtreecommitdiffstats
diff options
context:
space:
mode:
authoralevitskii <[email protected]>2025-08-26 08:52:24 +0300
committeralevitskii <[email protected]>2025-08-26 09:23:54 +0300
commit160ebae4e15b1a06e4cd65d2726fbd2133f2fb33 (patch)
tree146047632b505c2ce57cca4a23639f2d63746d7e
parente856b24bc4affa94efb17adb3c8f9d8d9752d0ec (diff)
Support wrapper script in STYLE_PYTHON
Support wrapper script in STYLE_PYTHON commit_hash:6386aba74650b4af488fda71e1f0568c7934d196
-rw-r--r--build/conf/python.conf2
-rw-r--r--build/external_resources/black/resources.json19
-rw-r--r--build/external_resources/black/ya.make5
-rw-r--r--build/plugins/ytest.py2
4 files changed, 27 insertions, 1 deletions
diff --git a/build/conf/python.conf b/build/conf/python.conf
index f0a73064a2c..fc3f5c22d8f 100644
--- a/build/conf/python.conf
+++ b/build/conf/python.conf
@@ -313,7 +313,7 @@ macro STYLE_DUMMY() {
### Check python3 sources for style issues using black.
macro STYLE_PYTHON(CONFIG_TYPE="") {
.ALLOWED_IN_LINTERS_MAKE=yes
- _ADD_PY_LINTER_CHECK(NAME black LINTER tools/black_linter/black_linter FILE_PROCESSING_TIME $BLACK_FILE_PROCESSING_TIME CONFIGS $PYTHON_LINTERS_DEFAULT_CONFIGS CONFIG_TYPE $CONFIG_TYPE)
+ _ADD_PY_LINTER_CHECK(NAME black WRAPPER_SCRIPT tools/black_linter/bin/main2.py LINTER tools/black_linter/black_linter GLOBAL_RESOURCES build/external_resources/black FILE_PROCESSING_TIME $BLACK_FILE_PROCESSING_TIME CONFIGS $PYTHON_LINTERS_DEFAULT_CONFIGS CONFIG_TYPE $CONFIG_TYPE)
}
# tag:python-specific tag:test
diff --git a/build/external_resources/black/resources.json b/build/external_resources/black/resources.json
new file mode 100644
index 00000000000..1cd1f85ec30
--- /dev/null
+++ b/build/external_resources/black/resources.json
@@ -0,0 +1,19 @@
+{
+ "by_platform": {
+ "darwin": {
+ "uri": "sbr:9500275477"
+ },
+ "darwin-arm64": {
+ "uri": "sbr:9500273230"
+ },
+ "linux": {
+ "uri": "sbr:9500279893"
+ },
+ "linux-aarch64": {
+ "uri": "sbr:9500277699"
+ },
+ "win32": {
+ "uri": "sbr:9500271272"
+ }
+ }
+}
diff --git a/build/external_resources/black/ya.make b/build/external_resources/black/ya.make
new file mode 100644
index 00000000000..40c1943e078
--- /dev/null
+++ b/build/external_resources/black/ya.make
@@ -0,0 +1,5 @@
+RESOURCES_LIBRARY()
+
+DECLARE_EXTERNAL_HOST_RESOURCES_BUNDLE_BY_JSON(BLACK resources.json)
+
+END()
diff --git a/build/plugins/ytest.py b/build/plugins/ytest.py
index 2e3d2d46717..f3f82c4e607 100644
--- a/build/plugins/ytest.py
+++ b/build/plugins/ytest.py
@@ -1066,6 +1066,7 @@ def on_add_cpp_linter_check(fields, unit, *args):
(
df.TestFiles.py_linter_files,
df.LintConfigs.python_configs,
+ df.LintWrapperScript.value,
)
+ LINTER_FIELDS_BASE
)
@@ -1081,6 +1082,7 @@ def on_add_py_linter_check(fields, unit, *args):
keywords = {
"NAME": 1,
"LINTER": 1,
+ "WRAPPER_SCRIPT": 1,
"DEPENDS": unlimited,
"CONFIGS": 1,
"GLOBAL_RESOURCES": unlimited,