wencan
V2EX  ›  Python

vscode Ruff 有时不格式化 f-string 内的代码什么情况?

By wencan at 2025 年 2 月 14 日 · 4941 次点击

两台电脑 linux 发行版不同 都安装着 vscode+Ruff 同样的项目代码 vscode 版本,一个是 1.97.2 ,一个 1.97.1 1.97.1 正常格式化 f-string ,但 1.97.2 只格式化 f-string 之外的代码,手动执行也不行 尝试了把 1.97.2 的用户数据配置文件全删了,仅安装 python 和 Ruff 两个扩展(含自动安装的),复制另一台电脑的 vscode 配置文件,但还是不能补全

2 条回复
wencan
   1
wencan  
OP
   2025 年 2 月 14 日
pip 更新下 ruff 好了
ruff 版本太旧
hotsymbol
   2
hotsymbol  
   2025 年 2 月 15 日
换成 Rust 写
推荐学习书目
› Learn Python the Hard Way
Python Sites
› PyPI - Python Package Index
› http://diveintopython.org/toc/index.html
› Pocoo
值得关注的项目
› PyPy
› Celery
› Jinja2
› Read the Docs
› gevent
› pyenv
› virtualenv
› Stackless Python
› Beautiful Soup
› 结巴中文分词
› Green Unicorn
› Sentry
› Shovel
› Pyflakes
› pytest
Python 编程
› pep8 Checker
Styles
› PEP 8
› Google Python Style Guide
› Code Style from The Hitchhiker's Guide
© 2026 V2EX · 27ms · 3.9.8.5