Skip to content

Rake/Require: Flag use of `require` in `namespace` blocks

Peter Leitzen requested to merge pl-rubocop-rake-require-namespace into master

What does this MR do and why?

In Rake, namespace blocks are eagerly loaded so RuboCop needs to flag the use of require as well.

This MR makes Rake/Require ignore require expressions inside "static" method definitions like:

# good
def self.run
  require "something"

Refs !147182 (comment 1862519812)

Rake/Require was added in !101740 (merged).

MR acceptance checklist

Please evaluate this MR against the MR acceptance checklist. It helps you analyze changes to reduce risks in quality, performance, reliability, security, and maintainability.

Edited by Peter Leitzen

Merge request reports