MarcoGorelli / cython-lint

Lint Cython files
MIT License
68 stars 11 forks source link

do not touch quotes inside f-strings #112

Open mironleon opened 2 months ago

mironleon commented 2 months ago

Fix for #111

This is a relatively blunt fix, but it solves my problem. This makes the code ignore all quotes inside of f-strings, which I think is what you would want in the general case.

mironleon commented 2 months ago

Bummer, it seems like https://docs.python.org/3.12/library/token.html#token.FSTRING_START was only added in python 3.12,

mironleon commented 2 months ago

@MarcoGorelli I figured out that the issue only exists for python 3.12, because of the changes they made to the tokenize library. So I adjusted the check to only run for python 3.12, and the testcases run fine

mironleon commented 2 months ago

That seems sensible yes.

100% test coverage is a worthy goal, that are some very stringent checks!

mironleon commented 3 weeks ago

Sorry I was under the impression that you would fix the test coverages, I will try to have a look at the pragmas this week

MarcoGorelli commented 3 weeks ago

cool, thanks 🙏 sorry that i wasn't clear