Skip to content

Don't verify module path for Naming/FileName cop

What does this MR do and why?

This causes false positives if the GitLab project is checked out inside a directory called src, which Rubocop incorrectly detects as the project root.

In practice this verification only seems to work correctly for certain directories like lib/ anyway, for app/ it only considers the filename and looks for a matching class definition, but ignores the module namespace.

Also see https://github.com/rubocop/rubocop/issues/6289

Slack discussion (internal): https://gitlab.slack.com/archives/C01NZFMRP88/p1634827871001800

MR acceptance checklist

This checklist encourages us to confirm any changes have been analyzed to reduce risks in quality, performance, reliability, security, and maintainability.

Edited by Markus Koller

Merge request reports