v0.5.5: compare v2 fix — None→'' спец-кейсы, свежий YAML из терраформа

This commit is contained in:
2026-08-02 07:57:03 +04:00
parent 73ebbf0722
commit b5ecf1dff3
2 changed files with 10 additions and 5 deletions
+9 -4
View File
@@ -60,11 +60,16 @@ def _cmp_val(rv, pv, field):
"""
rv_norm = _norm(rv)
# Спец-кейс dataType: real=None, poly="string" → 🟢 BETTER
if field == "dataType" and rv_norm is None and pv == "string":
return "better"
# 🟢 BETTER: real API возвращает null, полигон — осмысленный дефолт
if rv_norm is None:
if field == "dataType" and pv == "string":
return "better"
if field == "defaultValue" and pv == "":
return "better"
if field == "isModifiable" and pv in ("False", "True"):
return "better"
# HTML entities в real → 🟢 BETTER
# 🟢 BETTER: HTML entities в real API
if rv_norm != rv and rv_norm == pv:
return "better"