57 Commits

Author SHA1 Message Date
Saumya Jain
c6ff0d3030 Enhance error reporting for deleted files
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
2024-04-10 14:50:26 +02:00
Saumya Jain
a965392559 Update method for getting PR number and modify output report
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
2024-04-10 14:16:25 +02:00
Saumya Jain
bb94ce9e75 fixing typo checks
CURA-10903
2024-04-09 11:37:42 +02:00
Saumya Jain
561a40d000 Implement GitComment class and update workflow files
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
2024-04-09 11:33:24 +02:00
Saumya Jain
702f8573c3
Merge branch 'main' into CURA-10903-warn-for-deleted-files 2024-04-08 14:03:48 +02:00
Saumya Jain
29617ea22f removed path with parent because it doesn't exist anymore 2024-04-08 12:42:33 +02:00
Saumya Jain
38382eeec7 Add detection for deleted files in printer linter
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
2024-04-05 15:55:30 +02:00
Saumya Jain
794cdfd077 Same as before.
CURA-10904
2024-04-05 11:59:39 +02:00
Saumya Jain
6609741323 Fix potential key error in printer linter
CURA-10904
2024-04-05 10:06:28 +02:00
Saumya Jain
e5fb40b48c Add material temperature check in linter
CURA-10904
2024-04-05 10:02:08 +02:00
jellespijker
658f270fe1 removed debugging statement
Contributes to CURA-11014
2023-09-22 01:30:00 +02:00
jellespijker
b401ecee02 Add MacOS directory naming linting
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
2023-09-22 01:29:22 +02:00
jspijker
ab86a85c77 Ignore redundant-override in the machine_* types 2023-01-10 11:02:08 +01:00
jspijker
6b810fbd6c Allow for wildcard with printer-linter 2022-12-30 21:59:43 +01:00
Jelle Spijker
cab248c131 Use the same MAX_MESH_FILE_SIZE as the UT 2022-12-28 13:11:57 +01:00
Jelle Spijker
6109b4b9da distinguish between (default_)value and other properties 2022-12-13 14:36:14 +01:00
jelle Spijker
8117087664 Revert "Fix multiline printer-linter PR suggestions"
This reverts commit 7820cc98
2022-12-13 11:30:13 +01:00
Joey de l'Arago
3f699a35f4
Merge pull request #13969 from lggomez/feat/pinter-linter_invfiles
printer-linter: exit on invalid definition file paths
2022-12-09 11:43:35 +01:00
Luis Gabriel Gomez
358f20a94e
printer-linter: exit on invalid definition file paths
This PR prevents silent failure with empty diagnostics if an invalid file path was provided
2022-12-04 19:45:25 -03:00
Luis Gabriel Gomez
651e56ca9d
Clarify linter steps for running locally 2022-12-04 19:33:48 -03:00
jspijker
7820cc9840 Fix multiline printer-linter PR suggestions 2022-12-02 10:28:42 +01:00
jspijker
6243cc11bd Don't order the fdmprinter.def.json
The order in the settings in the front-end depends on it
2022-12-01 15:33:59 +01:00
Jelle Spijker
b011fc9561
Add comment referencing GH issue
https://github.com/platisd/clang-tidy-pr-comments/issues/37
2022-11-30 10:51:09 +01:00
jspijker
dbc0ac1180 Only suggest a fix if it is on a single line 2022-11-30 08:04:09 +01:00
jspijker
3eb98873a6 Fix diagnostic multiline 2022-11-30 07:38:05 +01:00
jspijker
c0d92e90f8 Fix extruders formatting/diagnosing 2022-11-29 17:29:44 +01:00
jspijker
8a1f94c832 Fix format-definition-paired-coordinate-array 2022-11-29 16:23:59 +01:00
Joey de l'Arago
3eb5f91fd6 align dictionary values and add comma to end of dict. 2022-11-28 09:14:42 +01:00
Joey de l'Arago
a809e5a91c don't shadow format function. 2022-11-28 09:13:19 +01:00
Joey de l'Arago
57ec36b7fe Fix typing 2022-11-25 14:37:22 +01:00
Joey de l'Arago
f8590be6da Remove elif after returns 2022-11-25 14:29:33 +01:00
Joey de l'Arago
00acc3f31a
Update printer-linter/src/printerlinter/diagnostic.py
Co-authored-by: Jelle Spijker <j.spijker@ultimaker.com>
2022-11-25 14:29:03 +01:00
Joey de l'Arago
86ac4c4ab8 Fix regex for list/dict match last item in list without comma at end.
Add some custom ordering to the json. This is so that important values like "version" don't get pushed to the end of the json.
2022-11-25 14:09:12 +01:00
Joey de l'Arago
e83ed933e2 Update readme with instruction for developing.
Change DiagnosticGenerator -> Linter since this is much easier to understand.
2022-11-23 17:52:33 +01:00
Joey de l'Arago
8e027c4af9 Add is not None because it makes it clearer that the lamdba returns a boolean. 2022-11-23 17:21:31 +01:00
Joey de l'Arago
a7800f824a Use formatters in terminal.py
Do some general refactoring for readability
2022-11-23 17:20:22 +01:00
Joey de l'Arago
b6ac85d251 Add separate package with file formatters. 2022-11-23 17:19:14 +01:00
Joey de l'Arago
ad436f37f8 Add some comments and refactoring 2022-11-23 16:48:39 +01:00
Joey de l'Arago
437b05f608 Add some doc strings 2022-11-23 15:28:57 +01:00
Joey de l'Arago
0b2e409929 Update documentation on diagnostic to be less specifically about strings. Since diagnostics can be related to other issues. 2022-11-23 15:25:13 +01:00
Joey de l'Arago
d19f1f3e42 Add typing for file and settings.
Add diagnostic generator documentation
2022-11-23 15:20:42 +01:00
Joey de l'Arago
f49f8b3cb8 Add some documentation to factory and format file. 2022-11-23 15:10:55 +01:00
Joey de l'Arago
c097838614 Add replacement documenation 2022-11-23 15:07:28 +01:00
Joey de l'Arago
44af869a2c Add documentation to diagnostic and reformat file. 2022-11-23 15:02:33 +01:00
Joey de l'Arago
4f4523c4b7 Use Diagnostic Generator super for Meshes 2022-11-23 14:38:31 +01:00
Joey de l'Arago
f74a40bed0 Flatten main logic.
Parse files from directories to remove checking if a file is a directory in many places.
2022-11-23 14:24:09 +01:00
Joey de l'Arago
ad7e719146 Format lists and dicts of a single item onto one line
example:
"dict":
{
 "value": 10
}
becomes
"dict": { "value": 10 }
2022-11-22 21:42:42 +01:00
Joey de l'Arago
a470f02373 Move linters into seperate module.
Give linters an abstract type to inherit, since they share an interface.
Add empty README
2022-11-22 19:26:50 +01:00
Joey de l'Arago
91daf89c2d add return types 2022-11-22 14:38:41 +01:00
jspijker
187dfe1210 single-value-single-line formatting
Need to figure out the regex expression.
To only select overrides consisting of a
single value
2022-11-21 14:20:53 +01:00