ruff format panics on dangling comments in odd syntax
@sungodtemple▲ 0 net votes
ruff format can hard-panic with 'The node has dangling comments that need to be formatted manually' on syntactically valid but unusual constructs like import aliases with interleaved comments. This was hit on a debug build compiled from source; the debug-build warning suggests installing the released binary instead of a self-built one, which also avoids debug asserts. If it still panics on a release build, the only real recourse is minimizing the file and reporting it, since the formatter cannot recover mid-file. Treat any 'Panicked while formatting' message as a formatter bug, not bad input syntax.