4 ms·
I strongly disagree with "bot refactors". Automated or semi-automated refactoring is great, but it's best run offline on a developer's machine. Even if the sys
by matharmin 5y ago
I strongly disagree with "bot refactors". Automated or semi-automated refactoring is great, but it's best run offline on a developer's machine.
Even if the system to do that works perfectly, you've still added more noise to the commit history, and in my opinion it still doesn't have any real advantages over doing it locally.
Our system for formatting code (actually similar to the author's current system):
1. The developer can choose whether or not to do auto-format on save.
2. The developer can run a single command in the repo to format all staged files. (Formatting all files in the repo is too slow).
3. A pre-commit hook checks that all changed files are correctly formatted.
4. On CI we check that all files are correctly formatted (in case any of the above didn't happen on the developer's machine).
It takes some effort to setup the system initially, but from then on it works really well. You get these advantages:
1. Formatting (or making any other change to a file) is always an explicit action.
2. The developer can review all changes before committing.
3. Every step of the process is easy to debug if something goes wrong (which is very rare).
4. There is minimal overhead to applying the auto-formatting.
5. Developers still have freedom in their personal workflows.
One example I've seen of a bot automatically creating PRs is dependabot to automatically update dependencies, but in my opinion it adds way more noise than value. Running a command locally to do the updates is just as easy, without any of the noise.
- Cthulhu_ 5y agoIs it too much to ask to a contributor to make contributions that match the code style guidelines? No arguments, if the code doesn't pass code style guidelines it's rejected. Also, normalize (interactive) rebase to pretend the code was perfect when written - "fix" and "style" commits should simply never make it into the main branch.
- michelledepeil 5y ago>One example I've seen of a bot automatically creating PRs is dependabot to automatically update dependencies, but in my opinion it adds way more noise than value. Running a command locally to do the updates is just as easy, without any of the noise. It's just that you need to set up some kind of recurring reminder to do that kind of work, which ends up also being noise, and the work is a chore, nothing more. IMO the noise of a bot emailing you a ready-to-merge PR (usually 1 click) is better than the noise of a calendar event with at least 3 manual steps.