splint icon indicating copy to clipboard operation
splint copied to clipboard

FR: Add lint/redundant-do

Open NoahTheDuke opened this issue 1 year ago • 2 comments

As seen in these clj-kondo issues 1, 2, 3:

  • comment
  • delay via fn*
  • dosync via sync
  • dotimes via when
  • io! via do
  • letfn via letfn*
  • locking via try
  • sync via fn
  • while via when
  • with-bindings via fn
  • with-in-str via binding
  • with-local-vars via try
  • with-out-str via binding
  • catch within try
  • finally within try

Maybe include some mechanism for expanding this list? Configuration perhaps.

NoahTheDuke avatar May 16 '24 15:05 NoahTheDuke

Actually, given how style/useless-do is written, it covers all of these already because it only checks that it's not wrapping ~@body and it's not in an anonymous function literal.

NoahTheDuke avatar Aug 28 '24 15:08 NoahTheDuke

I'm a fool. style/useless-do is about single-element do calls. Instead, I want something like lint/redundant-do, an expansion of lint/loop-do.

NoahTheDuke avatar Aug 29 '24 15:08 NoahTheDuke