Fix formula check and correct error message

CURA-10901
This commit is contained in:
Saumya Jain 2024-04-09 16:19:49 +02:00
parent 9db52e3888
commit 01552556d8

View File

@ -22,7 +22,7 @@ class Formulas(Linter):
def check(self) -> Iterator[Diagnostic]: def check(self) -> Iterator[Diagnostic]:
if self._settings["checks"].get("diagnostic-incorrect-formula", False): if self._settings["checks"].get("diagnostic-incorrect-formula", False):
for check in self.checkFormulas: for check in self.checkFormulas():
yield check yield check
yield yield
@ -56,7 +56,7 @@ class Formulas(Linter):
yield Diagnostic( yield Diagnostic(
file=self._file, file=self._file,
diagnostic_name="diagnostic-incorrect-formula", diagnostic_name="diagnostic-incorrect-formula",
message=f"Given formula {value_dict} to calulate {key} of seems incorrect, Do you mean {self._correct_formula}? please correct the formula and try again.", message=f"Given formula {value_dict} to calulate {key} seems incorrect, Do you mean {self._correct_formula}? please correct the formula and try again.",
level="Error", level="Error",
offset=found.span(0)[0], offset=found.span(0)[0],
replacements=replacements replacements=replacements