From 0d340460c048cec7ee377b67e3bd405fd6120f20 Mon Sep 17 00:00:00 2001 From: LordBaryhobal Date: Sun, 8 Feb 2026 01:31:33 +0100 Subject: [PATCH] fix(formatter): add fstring alignment and zfill --- src/formatter.py | 6 ++++++ 1 file changed, 6 insertions(+) diff --git a/src/formatter.py b/src/formatter.py index 4bbb02f..dff9c81 100644 --- a/src/formatter.py +++ b/src/formatter.py @@ -193,6 +193,12 @@ class Formatter(Expr.Visitor[str], Stmt.Visitor[str]): def format_format_spec(self, spec: FormatSpec) -> str: res: str = "" + if spec.options.alignment is not None: + if spec.options.alignment.fill is not None: + res += spec.options.alignment.fill.lexeme + res += spec.options.alignment.align.lexeme + if spec.options.zfill: + res += "0" if spec.options.sign is not None: res += spec.options.sign.lexeme if spec.number.integral.width is not None: