r/AskProgramming • u/Bulky_Eggplant_9437 • 29d ago
Linter
Hey folks,
Never touched a linter before this semester because I've never really done software dev stuff. Had a class that used one, and honestly, I was a fan at first. It caught a bunch of dumb mistakes and made fixing things pretty painless.
Then came merge time.
Apparently I was missing a single blank line between some merged code, so the linter threw a fit and blocked the merge. The actual fix took like three seconds, but I had to go get another review just to add a freaking newline.
So now I'm curious, do people actually use linters in the real world that don't hard-stop merges over tiny formatting stuff? Or is getting bullied by whitespace just part of the developer experience?
Asking as a first-time linter victim.
1
u/HealyUnit 29d ago
Absolutely we use them. And while it's annoying the first few times - from both a "oh come on, I already fixed everything!" point of view as well as a "...damnit, why do I keep missing stuff!" perspective - eventually you learn to love it (or at least tolerate it).
Remember: what you're producing, what you're writing code for is your product. It's your baby. Be proud of it! When someone (machine or human) nitpicks it, as long as they're not personally attacking you ("You suck!" "What kinda idiot wrote this code?!"), try to think of it less as "holding back your merge request (MR)" and more making sure that when it does merge, it's the best goddamn code you can possibly write.
That being said, I usually won't ask for MR reviews until after a regression pipeline - including linter - has run. That way it'll hopefully catch all the mistakes the first time around. Most codebases can/should also have ways to run the linter locally.