File model elements are not sorted deterministically

When model element is edited and saved, the resulting file is sometimes rewritten with elements sorted differently. This decreases readability of git diffs.

Rules:

  • Namespaces on the top of the file (does not work, sometimes they are re-sorted) – they should be sorted by their names.
  • Elements within the file (does to work, sometimes they are re-sorted) – they should be sorted by their type (so elements from the same namespace are grouped together) and Id as that never changes
  • Attributes within the elements (works, they are sorted by name)
1 Like

This topic was automatically closed 2 days after the last reply. New replies are no longer allowed.

I propose an improvement here for sorting the elements. The purpose is that the files are also easier to read by humans. The elements (e.g. entity fields/actions/filters) should be ordered in the following way:

  1. Element name (so e.g. entity fields are grouped together)
  2. @name (so. e.g. entity fields are ordered by name first)
  3. @id (so order would stay the same in case there would be two elements with the same name within the same group)

This topic was automatically closed 2 days after the last reply. New replies are no longer allowed.