4 ms·
> This is why I love things like cargo fmt / go fmt / eslint / etc. I agree. Once I had the displeasure of working with a junior dev who was very prolific in p
by chipdart 2y ago
> This is why I love things like cargo fmt / go fmt / eslint / etc.
I agree. Once I had the displeasure of working with a junior dev who was very prolific in posting comments on style and if a space should be at the left or at the right of a symbol. It took me a few days of dealing with that noise to onboard a linter.
Even so the junior dev felt entitled to manifest how high their standards were by posting a torrent of comments in the PR that onboarded the team's official linter config.
But once the PR was approved and merged, surprise surprise: the junior dev's PR comment metrics dropped from dozens per PR to zero. The style guide didn't even had to be enforced.
The last I've heard about the junior dev was throwing a tantrum when one of their PRs received a comment from another team member asking to run the linter because it failed to adhere to the team's official style guide. Apparently the high standards and this attention to detail only went one way.
- plasticchris 2y agoThat’s why you hook the linter up so it runs on every commit / push. No need to ask, it always runs. And no need to quibble over style. Don’t like it? Change the linter.
- Aeolun 2y agoI very much dislike any process modifying my commit after I submit it. Rebasing becomes hell.
- plasticchris 2y agorun it in a hook that runs before the commit is made
- cempaka 2y agoYeah we just have any linter failures fail the CI build, but it's left up to submitters to decide how to resolve the violations.
- plasticchris 2y agoYeah, that’s what I meant in the first comment :)
- move-on-by 2y agoI agree that it should be hooked up to run as a precommit hook, but unfortunately that doesn’t always solve things. People can- and do- bypass precommit hooks. It happens all the time at my company with certain teams, but I’ve been unable to figure out why. Any precommit hook that should run- needs a correlating required PR action to verify any precommit expectations are met. Otherwise, people reviewing the PRs just assume it ran and the people bypassing it get away with it.
- cced 2y agoCreate a linting step that fails if running the linter creates a git diff delta.
- rurban 2y agoInstall pre-commit with various linters for all the languages and data files out there, and the problem is solved. I do it even for Makefile's and cmake. Add it to your CI also, make lint and a make fmt.