rubocop-rake icon indicating copy to clipboard operation
rubocop-rake copied to clipboard

Errors not detected in rakelib tasks

Open pboling opened this issue 2 years ago • 0 comments

Background

rakelib

The rakelib directory is the default location for Rake apps that are split across multiple files.

The location/name of the rakelib directory can be customized with:

spec = Gem::Specification.find_by_name "my_gem"
rakelib = "#{spec.gem_dir}/lib/my_gem/rakelib"
Rake.add_rakelib(rakelib)

* Note that customization via add_rakelib is not fully documented in the RDocs related to rakelib. rakelib does not have to be at the root alongside the main Rakefile.

Inside my rakelib I have a bunch of namespaced folders and *.rake files.

shared rake task

Gems with shared rake tasks generally place them in lib/my_gem/tasks.rake or similar, and instruct users to integrate with their Rakefile as require "my_gem/tasks.rake".

Expected

Any file in any subdirectory of RuboCop's working directory that matches Rakefile or *.rake, or any of the other standard Rake file names (rakefile.rb, etc) should be processed by this RuboCop extension.

Bug

  1. Within my_gem RuboCop violations in my rakelib are not detected (see above "rakelib").
  2. Within my_gem RuboCop violations in my shared rake task are not detected (see above "shared rake task").

The only issues that are detected in my_gem are in the root Rakefile.

pboling avatar Mar 23 '23 15:03 pboling