reek
reek copied to clipboard
Do not raise Utilityfunction for methods defined in a class_method block
Addresses https://github.com/troessner/reek/issues/1538
This PR implements a way to not raise UtilityFunction
warning for methods defined in class_methods
block
I am kind of hesitant to merge something that is specific to Rails but since it's seemingly used a lot...idk. Wdyt @mvz ?
Yes, I'm also wondering how we can support this in a more generic way. Also, I think there's in issue that the proposed solution will suppress UtilityFunction in the whole module instead of just inside the class_method
block. I need to look into this a little bit more over the weekend.
To generalize this, we could add a configuration option to list which methods introduce a block that defines class methods. The default option would be empty, but users can set it to [:class_methods]
if Reek is used in a Rails project.
Excellent idea @mvz!
@mvz nice idea, is there something in the project that I could reuse or base myself? Like a custom Rails configuration module or a class that does something similar
@mvz seems like we forgot this one, I can see that you assigned this to yourself, any chance you pick it up again?
Feel free to ping me again as well