17 Commits

Author SHA1 Message Date
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
jspijker
67688aad95 Formatted the messages 2022-11-21 13:11:52 +01:00
jspijker
0070cb7af0 flatten list 2022-11-21 10:58:28 +01:00
jspijker
4b455d45e9 Use same yaml structure as cling-tidy 2022-11-21 10:51:08 +01:00
jspijker
0c7807e0cd Create a proper Pyhton packages for printer-linter
Such that it can be downloaded, installed and used locally and on other
repo's actions etc
2022-11-20 12:16:37 +01:00
jspijker
49305474ea Added a diagnose flag
Allowing the user to opt-in or out of diagnosing the file
2022-11-20 10:46:21 +01:00
jspijker
cec022f330 Fix the fax value 2022-11-19 20:31:47 +01:00
jspijker
104bc585f4 Added a linting tool for Cura Printers and Profiles
printer-linter works of definitions, profiles and meshes;
It has various diagnostic checks. With possible suggestions for fixes.
It should also be able to fix certain diagnostic issues and it can be used
to format the files according to code-style.

It can output the diagnostics in a yaml file, which can then be used to comment
on PR's with suggestions to the author. Future PR.

The settings for the diagnostics and checks are defined in `.printer-linter`
and are very self explanatory.

```
checks:
    diagnostic-mesh-file-extension: true
    diagnostic-mesh-file-size: true
    diagnostic-definition-redundant-override: true
fixes:
    diagnostic-definition-redundant-override: true
format:
    format-definition-bracket-newline: false
    format-definition-paired-coordinate-array: true
    format-definition-sort-keys: true
    format-definition-indent: 4
    format-profile-space-around-delimiters: true
    format-profile-sort-keys: true
diagnostic-mesh-file-size: 1200000
```
2022-11-19 19:07:32 +01:00