Don't order the fdmprinter.def.json

The order in the settings in the front-end depends on it
This commit is contained in:
jspijker 2022-12-01 15:32:45 +01:00
parent 5e942dd269
commit 6243cc11bd

View File

@ -23,7 +23,6 @@ METADATA_SORT_PRIORITY = {
"platform": "4",
}
class DefJsonFormatter(FileFormatter):
def formatFile(self, file: Path):
""" Format .def.json files according to the rules in settings.
@ -34,7 +33,7 @@ class DefJsonFormatter(FileFormatter):
definition = json.loads(file.read_text(), object_pairs_hook=OrderedDict)
if self._settings["format"].get("format-definition-sort-keys", True):
if self._settings["format"].get("format-definition-sort-keys", True) and file.stem.split(".")[0] != "fdmprinter":
definition = self.order_keys(definition)
content = json.dumps(definition, indent=self._settings["format"].get("format-definition-indent", 4))