Closed threadreaper closed 1 year ago
@threadreaper thanks for raising this - definitely pretty weird.
Would you be able to post or email the whole file (or a minimal example to reproduce the issue)?
Unfortunately this happened in something I'm actively working on, and there have been a lot of changes to the file since I posted this. I'll do a little fiddling and see if I can reproduce the issue, but I have my doubts.
Will close for now - please do reopen if it reoccurs or there are any more details.
Checklist
Description
I got a really weird refactoring suggestion from Sourcery tonight. I have the following class in the project I'm working on:
Sourcery is triggering on the blank line right after the docstring in the accept() method, with the following message: Sourcery - Remove return or yield statements found outside function definitions
The suggested refactoring is:
The _is_at_end() method belongs to a whole different class, and Sourcery wants to insert that method declaration and its docstring in place of the whole block of the accept() method here. If I delete the blank line after the docstring in the accept method, the suggestion goes away. I'm not sure what could be triggering it, because there are no yield or return statements here, and if there were, they would be inside of a function definition anyway.
I will attach an excerpt from sourcery.log with what appears to be the relevant lines. sourcery log.txt
I really like Sourcery! This is the first time I've had any sort of an issue. Let me know if there's any more information I can provide that may be helpful.
Debug Information
IDE Version: VSCode v1.72.2
Sourcery Version: Sourcery 0.12.12
Operating system and Version: Windows 10