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

Unnecessary Function Arguments #6

Closed
elbrujohalcon opened this issue Jul 25, 2022 · 0 comments · Fixed by #36
Closed

Unnecessary Function Arguments #6

elbrujohalcon opened this issue Jul 25, 2022 · 0 comments · Fixed by #36
Assignees
Labels
rule Idea for a rule
Milestone

Comments

@elbrujohalcon
Copy link
Collaborator

Rule

A rule to detect unnecessary function arguments.
The rule emits a warning for each function argument that is consistently ignored in all function clauses.

Example

defmodule Hanky do
  def a_func(_ignored, not_ignored, _not_ignored) do
    not_ignored
  end
  def a_func(_ignored, _not_ignored, not_ignored) do
    not_ignored
  end
end

Meandro should warn us about the first parameter of a_func/2.

@elbrujohalcon elbrujohalcon added the rule Idea for a rule label Jul 25, 2022
@elbrujohalcon elbrujohalcon changed the title unnecessary_function_arguments Unnecessary Function Arguments Jul 25, 2022
@elbrujohalcon elbrujohalcon self-assigned this Jul 27, 2022
elbrujohalcon added a commit that referenced this issue Jul 28, 2022
* Add tests

* Get tests to run

* Initial naïve version of the rule

* Update test/rules/unnecessary_function_arguments/good.exs

Co-authored-by: Mackenzie <macoafi@gmail.com>
Signed-off-by: Brujo Benavides <elbrujohalcon@gmail.com>

* Format

Co-authored-by: Mackenzie <macoafi@gmail.com>
@elbrujohalcon elbrujohalcon added this to the 0.0.1 milestone Jul 29, 2022
Sign up for free to join this conversation on GitHub. Already have an account? Sign in to comment
Labels
rule Idea for a rule
Projects
None yet
Development

Successfully merging a pull request may close this issue.

1 participant