Back

Black安装和使用

Black是一个毫不妥协的python代码格式化工具, 特点是可配置项较少 Black依赖于python3.6+, 官方地址在https://github.com/psf/black

Install

pip install black

Configure

  • pyproject.toml

    [tool.black]
    skip-string-normalization = true  # 禁用双引号风格
    
  • pycharm

    • Create external tools

      windows: File -> Settings -> Tools -> External Tools

      External Tools

    • Configure file watcher

      File Watcher

comments powered by Disqus
Built with Hugo
Theme Stack designed by Jimmy