3 ms·
rubocop config in this scenario is objectively wrong in my opinion -- a better config would be to flag "foo if bar?" as linter violation and just never use it.
by breatheoften 6y ago
rubocop config in this scenario is objectively wrong in my opinion -- a better config would be to flag "foo if bar?" as linter violation and just never use it. (I would also forbid "unless" statements -- why the hell does anyone need unless??)
The only reasoning I need to support my opinion -- Ruby debuggers are not good enough to support mid line breakpoints -- so if you want to break only when the condition is true -- which is a very common thing if you are maintaining or debugging code you didn't write yourself -- you literally can't without changing the code or using a conditional breakpoint and duplicating the conditional inside the breakpoint definition -- this is very annoying when tracing unfamiliar code and trying to figure out what invariants are relevant to a given scenario (or missing).
In my opinion - linters need an actual concept of a user that they are trying to help -- and ideally that concept should lead to objective opinions. Linters like rubocop that are just piles of functionality tend to be breeding grounds for time wasting arguments between insufficiently experienced developers over opinions that aren't supportable from any usefully pragmatic basis.