Rubocop: Gem does not include rake tasks (eg. new_cop)

Created on 12 Jul 2017  路  2Comments  路  Source: rubocop-hq/rubocop

Installing rubocop as a gem does not appear to provide the new_cop rake task. Also,

bundle exec rake new_cop[Category/Name]

does not work in my experience:

bundle exec rake "new_cop[Category/Name]"

is needed.


Expected behavior

Installing the rubocop gem should provide the new_cop task

Actual behavior

new_cop was not found

Steps to reproduce the problem

gem install rubocop

$ ls ~/.rbenv/versions/2.3.4/lib/ruby/gems/2.3.0/gems/rubocop-0.49.1/
LICENSE.txt  README.md  assets  bin  config  lib

RuboCop version

Include the output of rubocop -V. Here's an example:

$ rubocop -V
0.49.1 (using Parser 2.4.0.0, running on ruby 2.3.4 x86_64-darwin16)

Most helpful comment

Are you intending to use it to add a project specific cop? We don't have full support for that yet, i.e. you can add new cops in your project (by inheriting Cop) but you can't add configuration for it.

The rake task is meant for internal use. When we add full support for project specific cops, it should most likely be handled through a generator. 馃檪 E.g.: rubocop generate cop Project/CustomCop

All 2 comments

Are you intending to use it to add a project specific cop? We don't have full support for that yet, i.e. you can add new cops in your project (by inheriting Cop) but you can't add configuration for it.

The rake task is meant for internal use. When we add full support for project specific cops, it should most likely be handled through a generator. 馃檪 E.g.: rubocop generate cop Project/CustomCop

The rake task is meant for internal use. When we add full support for project specific cops, it should most likely be handled through a generator. 馃檪 E.g.: rubocop generate cop Project/CustomCop
馃憤 2

Interesting idea.

Was this page helpful?
0 / 5 - 0 ratings

Related issues

mlammers picture mlammers  路  3Comments

bbugh picture bbugh  路  3Comments

Aqualon picture Aqualon  路  3Comments

bquorning picture bquorning  路  3Comments

deivid-rodriguez picture deivid-rodriguez  路  3Comments