Sort frozenset literals in generated options class definition
This commit is contained in:
parent
37cdaea9ed
commit
214631c2dd
@ -125,7 +125,11 @@ def generate_class(defn: Definition, loc: str) -> Tuple[str, str]:
|
||||
if func.__module__ != 'builtins':
|
||||
tc_imports.add((func.__module__, func.__name__))
|
||||
|
||||
defval = repr(func(option.defval_as_string))
|
||||
defval_as_obj = func(option.defval_as_string)
|
||||
if isinstance(defval_as_obj, frozenset):
|
||||
defval = 'frozenset({' + ', '.join(repr(x) for x in sorted(defval_as_obj)) + '})'
|
||||
else:
|
||||
defval = repr(defval_as_obj)
|
||||
if len(defval) > 100:
|
||||
defval += ' # noqa'
|
||||
if option.macos_defval is not unset:
|
||||
|
||||
2
kitty/options/types.py
generated
2
kitty/options/types.py
generated
@ -485,7 +485,7 @@ class Options:
|
||||
click_interval: float = -1.0
|
||||
clipboard_control: typing.Tuple[str, ...] = ('write-clipboard', 'write-primary', 'read-clipboard-ask', 'read-primary-ask')
|
||||
clipboard_max_size: float = 64.0
|
||||
clone_source_strategies: typing.FrozenSet[str] = frozenset({'conda', 'env_var', 'venv', 'path'})
|
||||
clone_source_strategies: typing.FrozenSet[str] = frozenset({'conda', 'env_var', 'path', 'venv'})
|
||||
close_on_child_death: bool = False
|
||||
command_on_bell: typing.List[str] = ['none']
|
||||
confirm_os_window_close: int = -1
|
||||
|
||||
Loading…
x
Reference in New Issue
Block a user