Skip to content

Stop checking file locations programmatically

Problem

Checking file locations in RuboCop cop rules programmatically (via e.g. in_model?) is slow (see stack profile). RuboCop's Include/Exclude directives should be used instead.

Proposed solution

Create a 🆕 👮 rule in InternalAffairs:

  1. Ban methods of form in_X(node)? and encourage the use of RuboCop's Include/Exclude configuration directives
  2. Ban use of source_buffer.name

Locations

gitlab-styles

gitlab-org/gitlab

Prior discussion

The following discussion from !156 (merged) should be addressed:

Edited by Peter Leitzen