Skip to content
New issue

Have a question about this project? Sign up for a free GitHub account to open an issue and contact its maintainers and the community.

By clicking “Sign up for GitHub”, you agree to our terms of service and privacy statement. We’ll occasionally send you account related emails.

Already on GitHub? Sign in to your account

Rule to forbid redefinition of same Var with def #211

Open
AhmedAzzabi opened this issue Feb 27, 2018 · 2 comments
Open

Rule to forbid redefinition of same Var with def #211

AhmedAzzabi opened this issue Feb 27, 2018 · 2 comments

Comments

@AhmedAzzabi
Copy link

AhmedAzzabi commented Feb 27, 2018

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.

@arrdem
Copy link
Collaborator

arrdem commented Feb 27, 2018

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?

@danielcompton
Copy link
Member

This might be a better rule for Eastwood than Kibit also?

Sign up for free to join this conversation on GitHub. Already have an account? Sign in to comment
Labels
None yet
Projects
None yet
Development

No branches or pull requests

3 participants