Hello everybody, I released zpretty, a tool for making xml-ish files look like if they were "PEP8-ified".
Given that many of you like PEP8, maybe you will also like zpretty
The main reason I developed this package is that I hate checking the diffs of this kind of files.
I am thinking to customized templates when you upgrade an add on (or Plone itself), generic setup files customized TTW that should me merged back in your package, merging refactored page templates, and so on.
If you "zprettify" the files you are diffing, the job is much easier.
The goal is achieved formatting the XML with properly 2space nested elements, with sorted attributes, one per line and with a reasonable logic (e.g. class comes first, then id, data-attributes are grouped, tal attributes are sorted by they order of execution, i.e. define, condition, ...)
Bonus for Plonistas: tal:defines definitions are formatted one per line and a trailing semicolumn is always added (so the next time you add a definition you will have a one line diff).
The tool is highly opinionated and for sure there are alternatives (tidy, xmllint) that produce prettier output, but they will not sort work on attributes as well as zpretty is doing.
Source code/issue tracker available here: