[formatter] add 'format-operator-dot' option

to allow disabling the behavior introduced in commit
a79a945494
This commit is contained in:
Mike Fährmann
2026-01-13 22:25:37 +01:00
parent 812482e53e
commit 29e8440ec4
2 changed files with 20 additions and 1 deletions

View File

@@ -120,7 +120,10 @@ def main():
elif filterenv.startswith("default"):
util.compile_expression = util.compile_expression_defaultdict
# format string separator
# format string options
if not config.get((), "format-operator-dot", True):
from . import formatter
formatter._attrgetter = formatter.operator.attrgetter
if separator := config.get((), "format-separator"):
from . import formatter
formatter._SEPARATOR = separator