2 ms·
Fortunately nowadays formatting issues can be delegated to autoformatting in any popular language. Some people still argue over autoformatter parameters, but t
by desdenova 2y ago
Fortunately nowadays formatting issues can be delegated to autoformatting in any popular language.
Some people still argue over autoformatter parameters, but then people will always find a bike shed to argue about.
- noahjk 2y agoMaybe a new paradigm for code formatting could be local-only. Your editor automatically formats files the way you like to see them, and then de-formats back to match the codebase when pushing, making your changes match the codebase style.
- asdajksah2123 2y agoThis is pretty common now. At least my Vim/git combo does this, where I always open source code with my preferred formatting but by the time it's pushed to the server it's changed to match the repo preferences.
- tele_ski 2y agoIt's a decent idea, but it's weird reviewing code you wrote in saying GitHub, it looks totally different. Imo not a show stopper but a side effect you have to get used to.
- maccard 2y agoI’d like to think that GitHub would be able to display with my editor format settings.
- ruined 2y agothis works for pure formatting, but falls apart when you start linting to exclude certain syntax or patterns
- withinboredom 2y agoThis is disastrously easy to implement with just a few filters on git (clean & smudge). I highly recommend it though, especially if you worked for a long time at one company and are used to a specific way of writing code. Or if you like tabs instead of spaces...
- Braini 2y agoThis was such a relieve for us. Looking back its unbelievable how much combined time we wasted complaining about and fixing formatting issues in code reviews and reformatting in general. With clang-format & co. on Save plus possibly a git hook this all went away. It might not always be perfect (which is subjective anyway) but its so worth it.