sourcery icon indicating copy to clipboard operation
sourcery copied to clipboard

"<" character disappeared

Open Alex-CodeLab opened this issue 3 years ago • 2 comments

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

Alex-CodeLab avatar Aug 01 '22 16:08 Alex-CodeLab

Hi @Alex-CodeLab ,

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

Do I understand it correctly?

  • In the Sourcery PyCharm plugin, a diff is shown where the < character is missing.
  • When you apply the refactoring, it works as expected.

That sounds strange indeed. :thinking:

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

reka avatar Aug 01 '22 21:08 reka

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 avatar Aug 08 '22 08:08 brendanator

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

brendanator avatar Aug 12 '22 13:08 brendanator

Fixed in 0.12.7

Hellebore avatar Aug 29 '22 17:08 Hellebore