sourcery-ai / sourcery

Instant AI code reviews
https://sourcery.ai
MIT License
1.53k stars 66 forks source link

"<" character disappeared #260

Closed Alex-CodeLab closed 2 years ago

Alex-CodeLab commented 2 years ago

Issue description or question

def __repr__(self):
    return "<%s: %s>" % (self.__class__.__name__, self)

is listed as

def __repr__(self):
   -  return "%s: %s>" % (self.__class__.__name__, self) 
   +  return f"{self.__class__.__name__}: {self}>" 

Note the missing <

But when applying the suggestion it works anyway.

Sourcery Version

latest (?)

Code editor or IDE name and version

Pycharm v? 2022.2

OS name and version

Linux ubuntu

reka commented 2 years ago

Hi @Alex-CodeLab ,

Thanks a lot for reporting this issue. :+1:

Do I understand it correctly?

That sounds strange indeed. :thinking:

We'll look into it and let you know when a fix is available.

brendanator commented 2 years ago

Hi @Alex-CodeLab,

I've run this locally and I get the following suggestion which looks correct:

image

Please can you check you're using the latest version of Sourcery in PyCharm by going to Preferences > Plugins > Sourcery and ensure you are on version 0.12.6

brendanator commented 2 years ago

My mistake, I wasn't trying this in PyCharm. I have now successfully reproduced this and have a fix for the next release

Hellebore commented 2 years ago

Fixed in 0.12.7