4 ms·
This is getting closer to my dream setup of being able to open files in my formatting, and saving them in the team's formatting. Formatting source code feels l
by MisterKent 10y ago
This is getting closer to my dream setup of being able to open files in my formatting, and saving them in the team's formatting.
Formatting source code feels like a complete waste of developer time and energy, especially when they don't agree with how the team has decided to format the code. I almost wish source code files could be just serialized ASTs and that a VCS could understand them making merges etc. even easier.
- tyingq 10y agoI'm surprised that doesn't exist. When I did a lot of Perl in a team environment, we used perltidy. Helpful since Perl does little to encourage uniformity. It could take any sort of style in, and produce any sort of style out. Things like K&R blocks vs Allman-style blocks, tabs vs spaces, line wrapping, cuddled/not-cuddled else, etc. http://perltidy.sourceforge.net/stylekey.html http://perltidy.sourceforge.net/stylekey.html Edit: this looks pretty close to the same thing for JavaScript. Missing some style options, and not command line driven, but the general idea seems close: https://github.com/benjamn/recast/blob/master/README.md https://github.com/benjamn/recast/blob/master/README.md