kibit
kibit copied to clipboard
Rule to forbid redefinition of same Var with def
How can I add a rule to get warnings when I bind the same var more than once? Is this possible with kibit? This is very useful especially for functions.
Hey @AhmedAzzabi, if I understand your question correctly, you're asking if Kibit can detect def f "after" def f? I think the short answer is not at present, although you could probably write such an analysis. One thing to keep in mind here is that the declare macro is generally considered good style, and the defonce macro also does some interesting things with def. So it's not actually sufficient to know that there exist multiple defs of a given var because that quite probably is fine.
What particular behavior are you trying to detect? Can you give us an example?
This might be a better rule for Eastwood than Kibit also?