Commit graph

15 commits

Author SHA1 Message Date
Erwan MATHIEU
639fcca86a Fix possible crash of formulas checker 2024-06-17 13:59:56 +02:00
Saumya Jain
039b6ed2c2 Remove 'upper' from available formula functions
CURA-10901
2024-04-19 17:32:40 +02:00
Saumya Jain
72bf639bea Remove unnecessary formulas from linter
These formulas or modules are not used in definition files , so removing them

CURA-10901
2024-04-19 17:31:08 +02:00
Saumya Jain
1f2e690809 Extend list of formula names in linter
The list of formula names in the printer-linter's formula linter has been expanded. New entries include various mathematical functions (e.g., "max", "min", "sqrt"), string manipulation functions ("lower", "upper", "startswith"), and cryptographic/hash functions ("hashlib", "md5").
2024-04-19 17:02:58 +02:00
Saumya Jain
fd388b5cb3 Modify Formulas class description and simplify return statement
CURA-10901
2024-04-18 11:53:38 +02:00
Saumya Jain
84f90eadf8 Adding strip as the github actions were not picking up text with extra spaces
CURA-10901
2024-04-10 14:53:49 +02:00
Saumya Jain
3987969a22 Simplify and optimize Cura settings list retrieval
Related Task: CURA-10901
2024-04-10 11:37:19 +02:00
Saumya Jain
dcd673a605 Refactor and enhance formula linter in printer-linter module
The update improves formula linting by refining the identification and correction processes of formula typos. It establishes a list of standard formula names and delimiters for better match and replacement operations. Additionally, it enhances error reporting, providing users with more specific and instructive feedback. The Cura settings list retrieval method has been optimized as well.

Related Task: CURA-10901
2024-04-10 10:53:17 +02:00
Saumya Jain
db0e46b252 Improve formula checks and error messages in printer-linter
This update enhances the checking of formula correctness in printer settings and provides clearer error messages when formulas appear incorrect. By getting a list of Cura setting variables and typical formula names, it uses these to match and replace incorrect segments in formulas, if any. Related code for error handling and message reporting are also revised to give more useful feedback to users for necessary corrections.

CURA-10901
2024-04-10 10:42:17 +02:00
Saumya Jain
01552556d8 Fix formula check and correct error message
CURA-10901
2024-04-09 16:19:49 +02:00
Saumya Jain
9db52e3888 Adding the replacement text for the maybe corrected formula
CURA-10901
2024-04-09 16:10:27 +02:00
Saumya Jain
eecf9cdebf Refactor formulas.py for improved formula handling
Imported difflib, re, and CuraFormulaFunctions for more efficient formula handling and error checking. This prevents crashes and improves the reliability of the application by suggesting the correct formula when an incorrect one is entered

CURA-10901
2024-04-08 17:56:14 +02:00
Saumya Jain
e15049f2e0 Update formulas handling
CURA-10901
2024-04-08 15:26:55 +02:00
Saumya Jain
8e9ebb6832 Consistent for naming convention
CURA-10901
2024-04-08 10:25:23 +02:00
Saumya Jain
fe0120ef64 Add Formulas linter and integrate with factory
A new linter class, Formulas, has been added to check for issues in definition files, particularly with default parameters overrides. It has been integrated into the Linter factory to also check '.inst.cfg' and '.def.json' files for formulas-related issues. Additionally, a new 'diagnostic-incorrect-formula' check has been included in the .printer-linter configuration.

CURA-10901
2024-04-05 18:18:40 +02:00