MartinThoma / flake8-simplify

❄ A flake8 plugin that helps you to simplify code
MIT License
186 stars 19 forks source link

Use repr when printing strings #145

Open ItsDrike opened 2 years ago

ItsDrike commented 2 years ago

Desired change

Explanation

With an if statement like this:

if "}\n" == line:
    ...

the current version of flake8-simplify prints the }\n string with an actual new line, instead of escaping the special newline character, like doing repr("}\n") would. This looks very weird, and many editors don't support it and only print the first line, which is misleading: image