-
Notifications
You must be signed in to change notification settings - Fork 13
Introduce a module for checks specific to Elixir #55
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
Conversation
177b5f2 to
4e46850
Compare
I don't think so. Consider: We pattern match on the same type multiple times, i.e. we have more function clauses than spec clauses and it's fine.
This is a good question. Let's go with one spec per function clause and see how that works on real world code - either by testing or based on community feedback. |
03377cd to
2ab27e0
Compare
2ab27e0 to
9926c05
Compare
42d3c36 to
cb4a98d
Compare
|
This is awesome 🚀 |
This PR focuses on #36 and introduces a new module that provides checks specific to Elixir. There's an option
ex_checkthat allows to deactivate theElixirCheckerand use only Gradualizer checks.Steps
ElixirCheckermodule.Spec location
Currently, it can check whether the
specattribute is used correctly. We decided that spec must be placed above function which it concerns, and only one spec per function clause is allowed. The acceptable spec location:Incorrect spec location:
Questions
I wonder if I should check if the number of specs for a function is less than or equal to the number of function clauses?
Is it ok to have more the one spec before a function clause, or better to allow only one spec per one clause?
How to improve the proposed error messages?