bouts0309

VSCode 在 venv 环境下格式化 Python 代码的正确方式是什么

  •  
  •   bouts0309 · May 7 · 3184 views
    This topic created in 186 days ago, the information mentioned may be changed or developed.

    为了轻量用的 vscode ,结果格式化 Python 代码就恶心了半天

    试了 autopep8 和 black 插件,settings.json 也写了插件也安装了甚至 pip 也安装试了一下都不行

    9 replies  •  2026-05-08 11:48:05 +08:00
    ManjusakaL
    1
    配置 precommit ,提交的时候统一格式化
    xuanbg
    xuanbg
    May 8
    2
    不是,别的语音可以自动格式化,Python 这个你怎么敢的
    iorilu
    iorilu
    May 8
    3
    现在都默认用 ruff 了阿
    ClosureEleven
    5
    同推荐 ruff
    Etuloser
    6
    ruff + uv
    coreJK
    coreJK
    May 8
    7
    uv 管理项目和依赖,ruff 格式化和检查代码风格
    bouts0309
    bouts0309
    OP
    May 8
    8
    @iorilu @oyex @ClosureEleven @Etuloser @coreJK 谢谢各位,已经用上了 ruff 了。一开始没有提示,后来配置了一下 settings 可以了
    JustGoGoGo
    9
    uv + ruff + ty ,astral 全家桶真的推荐
    About   ·   Help   ·   Advertise   ·   Blog   ·   API   ·   FAQ   ·   Privacy   ·   Solana   ·   1121 Online   Highest 6679   ·     Select Language
    创意工作者们的社区
    World is powered by solitude
    VERSION: 3.9.8.5 · 33ms · UTC 18:05 · PVG 02:05 · LAX 10:05 · JFK 13:05
    ♥ Do have faith in what you're doing.