Saumya Jain 284f8e2d6d Merge branch 'main' into CURA-10901-warn-if-formulas-are-NOK | 7 месяцев назад | |
---|---|---|
.. | ||
src | 7 месяцев назад | |
README.md | 2 лет назад | |
pyproject.toml | 8 месяцев назад | |
setup.cfg | 2 лет назад | |
setup.py | 2 лет назад |
Printer linter is a python package that does linting on Cura definitions files. Running this on your definition files will get them ready for a pull request.
From the Cura root folder and pointing to the relative paths of the wanted definition files:
python3 printer-linter/src/terminal.py "resources/definitions/flashforge_dreamer_nx.def.json" "resources/definitions/flashforge_base.def.json" --fix --format
Inside .printer-linter
you can find a list of rules. These are seperated into roughly three categories.
diagnostic-mesh-file-extension
this checks if a mesh file extension is acceptable.format-definition-bracket-newline
This rule says that when assigning a dict value the bracket should go on a new line.diagnostic-definition-redundant-override
This removes settings that have already been defined by a parent definitionLinters 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 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