Skip to content

Add cop to make sure we don't use ivar in a module

Lin Jen-Shin requested to merge no-ivar-in-modules into master

To see the rationale behind this, please check: https://gitlab.com/gitlab-org/gitlab-ce/blob/no-ivar-in-modules/doc/development/module_with_instance_variables.md

What does this MR do?

Add a cop to make sure we don't use instance variables in a module.

Are there points in the code the reviewer needs to double check?

Hopefully some moving around doesn't break anything. We'll disable this cop for some legacy modules because it's very hard to decouple them at the moment.

Why was this MR needed?

Using instance variables in a module is a bad smell, because it's very hard to track where they're coming from, and they're also very order sensitive.

Does this MR meet the acceptance criteria?

What are the relevant issue numbers?

Edited by Lin Jen-Shin

Merge request reports