Closed luisfpereira closed 2 years ago
Smart idea. Thanks. Could you please add at least one test case? Because there is a new condition int(self.start_line != self.end_line)
in the pull request.
Probably the best way to go is to replace the condition int(self.start_line != self.end_line)
by + 1
. With this, functions that have same start and end lines will have length 1 (which I would say is consistent, as e.g.start_line=0
and end_line=1
leads to length=2
in the previous implementation).
Yesterday I chose to add the condition because some output tests were failing (as length
was initialize with 0), but now that I think more deeply about it, I think we should simply correct that tests.
What do you think?
Yes, I think correcting the test expectations is the right thing to do.
Small simplification of
FunctionInfo
'slength
in order to not care about it anywhere else during the parsing process.int(self.start_line != self.end_line)
only for consistency with equal start and end lines.