mirror of
https://github.com/Ultimaker/Cura.git
synced 2025-08-10 15:25:09 -06:00
Update readme with instruction for developing.
Change DiagnosticGenerator -> Linter since this is much easier to understand.
This commit is contained in:
parent
8e027c4af9
commit
e83ed933e2
10 changed files with 39 additions and 19 deletions
|
@ -8,4 +8,26 @@ From the Cura root folder.
|
|||
```python3 printer-linter/src/terminal.py "flashforge_dreamer_nx.def.json" "flashforge_base.def.json" --fix --format```
|
||||
|
||||
## Developing
|
||||
### Printer Linter Rules
|
||||
Inside ```.printer-linter``` you can find a list of rules. These are seperated into roughly three categories.
|
||||
|
||||
1. Checks
|
||||
1. These rules are about checking if a file meets some requirements that can't be fixed by replacing its content.
|
||||
2. An example of a check is ```diagnostic-mesh-file-extension``` this checks if a mesh file extension is acceptable.
|
||||
2. Format
|
||||
1. These rules are purely about how a file is structured, not content.
|
||||
2. An example of a format rule is ```format-definition-bracket-newline``` This rule says that when assigning a dict value the bracket should go on a new line.
|
||||
3. Fixes
|
||||
1. These are about the content of the file.
|
||||
2. An example of a fix is ```diagnostic-definition-redundant-override``` This removes settings that have already been defined by a parent definition
|
||||
|
||||
### Linters
|
||||
Linters find issues within a file. There are separate linters for each type of file. The linter that is used is decided by the create function in factory.py. All linters implement the abstract class Linter.
|
||||
|
||||
A Linter class returns an iterator of Diagnostics, each diagnostic is an issue with the file. The diagnostics can also contain suggested fixes.
|
||||
|
||||
### Formatters
|
||||
Formatters load a file reformat it and write it to disk. There are separate formatters for each file type. All formatters implement the abstract class Formatter.
|
||||
|
||||
Formatters should format based on the Format rules in .printer-linter
|
||||
|
||||
|
|
Loading…
Add table
Add a link
Reference in a new issue