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

Would you be interested in a Common Caveats rule? #484

Closed
adrianroe opened this issue Jun 28, 2018 · 5 comments
Closed

Would you be interested in a Common Caveats rule? #484

adrianroe opened this issue Jun 28, 2018 · 5 comments

Comments

@adrianroe
Copy link

A number of the common caveats listed in http://erlang.org/doc/efficiency_guide/commoncaveats.html could easily be picked up by Elvis. I have a local elvis_core that adds a common_caveats rule.

The code is essentially identical to no_debug_calls, so I made a common function (no_call) that they both call - just with different configs. I suspect it would be worth exposing no_call as a generic rule as well (with a default list of functions that is empty) to make it trivial for users to add "warn if anyone calls X/1, Y/2 or Z/3"...)

The common caveats themselves would include calls to timer:send_after / timer:send_interval, as well as erlang:size

@elbrujohalcon
Copy link
Member

Hi @adrianroe ! Yeah! Please send a PR with that rule and we can review it together :)

@elbrujohalcon
Copy link
Member

I also agree that no_call as a rule on its own makes sense.

@adrianroe
Copy link
Author

Excellent - I'll work on a PR tonight

@adrianroe
Copy link
Author

Pull request sent

@adrianroe
Copy link
Author

WIKI page updated with the new rules

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

2 participants