CURA-12548
Note that this is not technically required, because external contributors can change it anyway. However, making this change will silent a security warning raised by an automatic analysis tool, and it doesn't hurt.
As some translation files are named with a .def.json.pot extension, they were previously considered for checking as if they were definition files. They are now filtered out.
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").
The code now checks if a requested file is present in the files list before diagnosing issues and generating error reports for it. It will help prevent attempting to diagnose or report on files that do not exist or deleted, thus enhancing efficiency and preventing possible error generation
CURA-10903
The code updates the way we fetch the Pull Request number in the Github action. Rather than using an external action, we directly make use of Github's CLI, which helps improve the speed and reliability of the workflow. Additionally, the output report's format in terminal.py, previously named as "Git Comment", has been changed to "Error Files" to better reflect the information it carries.
CURA-10903
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
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
A new GitComment class was implemented to replace Diagnostic for deleted file checks. As part of this change, both main workflow files (printer-linter-pr-diagnose.yml and printer-linter-pr-post.yml) have been updated to accommodate this new class. Also, reports now use 'comment.md' instead of 'fixes.yml'. All of this is ultimately geared at improving diagnostic functionality and allowing deleted file checks to output directly to a Git comment.
CURA-10903
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
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
This update adds a new check for deleted files in the printer linter. This will alert the user when a file has been deleted that could potentially disrupt upgrade scripts. An argument "--deleted" is also added to terminal.py to facilitate this new check. Additionally, the printer-linter version has been incremented to 0.1.2.
CURA-10903
A new Linter subclass - 'Directory' has been created and integrated into the linting process to handle directory naming conventions, specifically for MacOS. MacOS has issues when signing and notarizing directories with '.' in their names. The new class will trigger an 'Error' level diagnostic if this convention is violated. The linter will become a required check with this update, as its new check configuration was added to '.printer-linter'. The version number in 'pyproject.toml' was also incremented to reflect these changes.
Contributes to CURA-11014