Re:Diffsitter: A tree-sitter based AST difftool to get meani...
by codetrotter on Sunday July 18, 2021 @03:21PM
(#27875762)
Not unless you you have a git hook to ensure that every commit is run through the auto formatter, and you additionally ensure that everyone that commits to the repositories you work on have this hook installed too. And even then, many people still interact with repositories that are outside of their power to enforce such rules upon.
[ Parent
| on HN ]
Re:Diffsitter: A tree-sitter based AST difftool to get meani...
by sahkopoyta on Sunday July 18, 2021 @05:24PM
(#27876814)
>git hook to ensure that every commit is run through the auto formatter, and you additionally ensure that everyone that commits to the repositories you work on have this hook installed too
Eg. with node project this is a trivial task with tools like Husky in place
Re:Diffsitter: A tree-sitter based AST difftool to get meani...
by kevincox on Sunday July 18, 2021 @07:10PM
(#27877533)
Not necessarily. You could also run the "unformatted" files through the formatter before doing the diff.
Re:Diffsitter: A tree-sitter based AST difftool to get meani...
by polynomial on Sunday July 18, 2021 @04:00PM
(#27876133)
sorry for the dumb question but why can't you use GH Actions for this? (Instead of making sure all committers have the hook installed.)