registry: Default to sorting sets of values

Not sorting them causes the config file to change when the bot writes
it, because order is nondeterministic.

This is usually fine, but can be annoying when configs are deployed
with Ansible.

Closes GH-1516
This commit is contained in:
Valentin Lorentz 2022-10-14 23:15:11 +02:00
parent 8c17505221
commit dc94f8dc68

View File

@ -875,6 +875,7 @@ class SpaceSeparatedListOfStrings(SpaceSeparatedListOf):
class SpaceSeparatedSetOfStrings(SpaceSeparatedListOfStrings):
__slots__ = ()
List = set
sorted = True
class CommaSeparatedListOfStrings(SeparatedListOf):
__slots__ = ()
@ -887,6 +888,7 @@ class CommaSeparatedSetOfStrings(SeparatedListOf):
__slots__ = ()
List = set
Value = String
sorted = True
def splitter(self, s):
return re.split(r'\s*,\s*', s)
joiner = ', '.join