3 ms·
I think that's the idea behind Go's 'gofmt'[1] tool; it even ships with a few scripts suitable for VCS commit hooks[2] It's an idea I've thought about before;
by shabble 14y ago
I think that's the idea behind Go's 'gofmt'[1] tool; it even ships with a few scripts suitable for VCS commit hooks[2]
It's an idea I've thought about before; allow users to define some sort of style profile for their editor, and reformat to/from the canonical representation before committing.
The biggest hurdle is of course tool support; if your web-based code review app is showing different code to what you're seeing in your emacs buffer, and different again from what your coworker is pastebinning from their gdb crash dump, Things Get Confusing.
Even something as simple as line-numbers not matching up can be quite irritating. Sourcemaps might be part of the solution for languages that support them, but there's still a hell of a lot of work in upgrading tools to support these sorts of features before you can expect them to become widespread.
[1] http://blog.golang.org/2013/01/go-fmt-your-code.html http://blog.golang.org/2013/01/go-fmt-your-code.html
[2] http://tip.golang.org/misc/git/pre-commit http://tip.golang.org/misc/git/pre-commit