jellespijker 658f270fe1 removed debugging statement | 1 year ago | |
---|---|---|
.. | ||
src | 1 year ago | |
README.md | 1 year ago | |
pyproject.toml | 1 year ago | |
setup.cfg | 1 year ago | |
setup.py | 1 year ago |
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