News for hackers. Stuff that matters.
Re: by keybored on Friday April 05, 2024 @05:33PM (#39947511)
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.

Re: by red0point on Friday April 05, 2024 @05:43PM (#39947615)
If 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#acc...

Re: by jupp0r on Friday April 05, 2024 @05:52PM (#39947698)
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. Everything else is just an upcoming post mortem with "we should have noticed this" waiting to happen to you.
Re: by keybored on Friday April 05, 2024 @06:15PM (#39947918)
> 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.

Re: by jupp0r on Friday April 05, 2024 @08:42PM (#39948975)
I 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.
Re: by Denvercoder9 on Friday April 05, 2024 @06:08PM (#39947847)
You 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).
Re: by phyzome on Friday April 05, 2024 @06:15PM (#39947922)
Generally you'll want to have some kind of linter in your build tool.