最新消息:雨落星辰是一个专注网站SEO优化、网站SEO诊断、搜索引擎研究、网络营销推广、网站策划运营及站长类的自媒体原创博客

python - How to ignore forced obsolete syntax under Ruff v0.11 - Stack Overflow

programmeradmin5浏览0评论

I'm maintaining a code that is used under Python versions 3.12 and 3.13. Ruff from version 0.11 started to complain:

SyntaxError: Cannot reuse outer quote character in f-strings on Python 3.9 (syntax was added in Python 3.12)

Not a problem, as the code was not intended to be compatible with earlier versions. But how can ignore these warnings from my pyproject.toml?

Strangely Ruff's error message doesn't refer to the rule number, and I haven't found the rule number by reading trough the rules on Ruff's manual either. AI's suggested me to try E999 -- didn't work.

I doubt that Ruff devs would force me to use obsolete syntax, but without any rule number to ignore I have to choose from the following:

  • downgrade my code to an older syntax
  • use an outdated version of Ruff
发布评论

评论列表(0)

  1. 暂无评论