Skip to content

Commit

Permalink
Fix an error when running rake new_cop
Browse files Browse the repository at this point in the history
Follow up to rubocop/rubocop#10109.

This commit fixes the following error.

```console
% bundle exec rake new_cop\[Department/CustomCop\]
rake aborted!
ArgumentError: wrong number of arguments (given 2, expected 1)
/Users/koic/src/github.com/rubocop/rubocop-performance/Rakefile:58:in
`new'
/Users/koic/src/github.com/rubocop/rubocop-performance/Rakefile:58:in
`block in <top (required)>'
/Users/koic/.rbenv/versions/3.1.0-dev/bin/bundle:23:in `load'
/Users/koic/.rbenv/versions/3.1.0-dev/bin/bundle:23:in `<main>'
Tasks: TOP => new_cop
(See full trace by running task with --trace)
```
  • Loading branch information
koic committed Oct 26, 2021
1 parent 9feae4b commit 467b8a1
Showing 1 changed file with 1 addition and 4 deletions.
5 changes: 1 addition & 4 deletions Rakefile
Original file line number Diff line number Diff line change
Expand Up @@ -52,10 +52,7 @@ task :new_cop, [:cop] do |_task, args|
exit!
end

github_user = `git config github.user`.chop
github_user = 'your_id' if github_user.empty?

generator = RuboCop::Cop::Generator.new(cop_name, github_user)
generator = RuboCop::Cop::Generator.new(cop_name)

generator.write_source
generator.write_spec
Expand Down

0 comments on commit 467b8a1

Please sign in to comment.