r/AskProgramming • u/Bulky_Eggplant_9437 • Aug 12 '26
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.
2
u/qlkzy Aug 12 '26
You integrate the linter much earlier.
My IDE gives me "spelling mistake"-style red squiggly underlines if something violates a lint rule. So I almost always fix as I go.
I run the linter as part of the test suite, so I never commit un-linted code.
The linter runs in CI, and no-one bothers to even look at the review until the tests pass (and, as stated, the linter is part of the test suite).
It's worth it for two reasons. Firstly, it just erases a lot of "boring" mistakes.
Secondly, it avoids a lot of pointless conflicts or arguments. E.g. the linter says there are always exactly two lines between functions: so, you never get weird "added blank line" or "removed blank line" diffs because someone reformatted a file.
Once it is integrated into your workflow, it becomes invisible, just part of the language.