I imagine a fancier version would be to compare the Abstract Syntax Trees.
The only issue is then you're at the mercy of whatever parser your formatter uses to construct the AST
The only issue is then you're at the mercy of whatever parser your formatter uses to construct the AST