3 ms·
Intellij has some nice static analysis for Java.[1] But I want it in my face. Because we had a bug where we used `==` on a boxed primitive. And the inspection d
by keybored 3y ago
Intellij has some nice static analysis for Java.[1] But I want it in my face. Because we had a bug where we used `==` on a boxed primitive. And the inspection didn’t help because it was just sitting there with some faint yellow background or whatever it is if you happened to visit that file. And the light-bulb action thing is effectively active on any line since you get the option of “invert conditional” or “use block in lambda” and useless things like that.
Well I’ll just hedge and say that it wasn’t obvious to the three of us how to get an in-your-face warning.
[1] EDIT: I realize now that my brain for some reason thought that “in your face” would immediately translate to everybody else as “fail the build”. What a drunken (but not drunk though) mistake.
- red0point 3y agoIf I remember correctly, there is an extensive „Inspection“ settings page where you can enable / disable / set the levels (hoe much in-your/face) of exactly such checks. Maybe this would suit you? https://www.jetbrains.com/help/idea/code-inspection.html#access-inspections-and-settings https://www.jetbrains.com/help/idea/code-inspection.html#acc...
- jupp0r 3y agoYou shouldn't rely on a human reading an in-their-face warning. If you consider a particular static analysis check to be vital, run it in CI and make the PR introducing it red. Everything else is just an upcoming post mortem with "we should have noticed this" waiting to happen to you.
- keybored 3y ago> You shouldn't rely on a human reading an in-their-face warning. If you consider a particular static analysis check to be vital, run it in CI and make the PR introducing it red. That’s what I meant (edited now). I want compilation to fail. Or whatever “CI” is. We didn’t find a way to promote inspections to some kind of static analysis run.
- jupp0r 3y agoI suspected that inspections would be tightly coupled to Jetbrain's IDEs (although I have no direct experience with them). There are probably equivalent static analysis tools available, but then you encounter the opposite problem of not having these errors available in your IDE, which is also not great for productivity.
- Denvercoder9 3y agoYou can change how inspection errors are shown under the Color Scheme settings. You can make it bold, striked out text with a bright red background if you want. I seem to remember at some point you could also make it blink, though I can't find that anymore (probably for the best).
- deleted 3y ago[deleted]
- phyzome 3y agoGenerally you'll want to have some kind of linter in your build tool.