-
Notifications
You must be signed in to change notification settings - Fork 283
Description
I did a quick search of the issues, both open and closed, but didn't see something like what I'm proposing.
The problem I am having is that reek is throwing up warnings for scaffolding code that hasn't yet been fleshed out. I've included an example below.
I'd like a mechanism that will let me suppress all warnings for a function in the particular instance that the function is not yet implemented.
It merits consideration because the alternative is going in by hand and notating every method (of which there can be many) with each of the specific errors reek is detecting for that instance. It's an ugly workaround that goes against the spirit of the tool.
I propose that we name it PendingImplementation. A wildcard operator would be just as effective, but what I like about PendingImplementation is that it can't be abused to silence the output of reek without drawing attention to itself.
Example of the problem:
# TODO: Implement this method
def my_undone_function(param1, param2, param3)
raise NotImplementedError.new("this function must be implemented")
super("currently unreachable, implementation relevant code")
endGenerates:
Errors on modified lines:
...: UnusedParameters: MyFictionalParent::MyFictionalChild#my_undone_function has unused parameter 'param1' [https://github.com/troessner/reek/blob/v5.0.2/docs/Unused-Parameters.md]
...: UnusedParameters: MyFictionalParent::MyFictionalChild#my_undone_function has unused parameter 'param2' [https://github.com/troessner/reek/blob/v5.0.2/docs/Unused-Parameters.md]
...: UnusedParameters: MyFictionalParent::MyFictionalChild#my_undone_function has unused parameter 'param3' [https://github.com/troessner/reek/blob/v5.0.2/docs/Unused-Parameters.md]
Potential solution:
...
# :reek:PendingImplementation
def my_undone_function(param1, param2, param3)
...Potentially generates:
Errors on modified lines:
...: PendingImplementation: MyFictionalParent::MyFictionalChild#my_undone_function has been marked as pending implementation [https://github.com/troessner/reek/..<relevant_doc>.md]
Thanks for your time. Let me know if a pull implementing this is something that will be considered.