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

New cop: Add an offense for def in task definition #1

Closed
pocke opened this issue Sep 4, 2019 · 0 comments · Fixed by #5
Closed

New cop: Add an offense for def in task definition #1

pocke opened this issue Sep 4, 2019 · 0 comments · Fixed by #5
Labels
enhancement New feature or request

Comments

@pocke
Copy link
Collaborator

pocke commented Sep 4, 2019

desc 'foo'
task :foo do
  def helper_method
  end
end

task does not create any namespace. It means the helper_method will define as a top-level method.
It is unexpected behavior in many cases, so a cop should mark the code as offensive.

@pocke pocke added the enhancement New feature or request label Sep 4, 2019
@pocke pocke closed this as completed in #5 Sep 17, 2019
Sign up for free to join this conversation on GitHub. Already have an account? Sign in to comment
Labels
enhancement New feature or request
Projects
None yet
Development

Successfully merging a pull request may close this issue.

1 participant