PyCharm 专业版中的自动格式化导入
Auto-formatting imports in PyCharm Professional Edition
我最近偶然发现 IntelliJ PyCharm PE 开始 自动优化 我的进口,但我从来没有 enabled/installed 这样的功能,但是我确实安装了 isort,不过我不记得它有自动优化的选项。有人知道如何解决这个问题吗?
示例:
我在看代码:
from here import this
from here2 import this2
from here1 import this1
当我通过 (Alt+0) PyCharm 的提交界面执行提交阶段时,它会将这些导入自动格式化为:
from here import this
from here1 import this1
from here2 import this2
事实证明,当 saving/commiting 通过位于 [= 下的 File Watchers 功能更改时,Pycharm 自动格式化我的导入17=] 部分,禁用它有助于自动格式化。
我最近偶然发现 IntelliJ PyCharm PE 开始 自动优化 我的进口,但我从来没有 enabled/installed 这样的功能,但是我确实安装了 isort,不过我不记得它有自动优化的选项。有人知道如何解决这个问题吗?
示例: 我在看代码:
from here import this
from here2 import this2
from here1 import this1
当我通过 (Alt+0) PyCharm 的提交界面执行提交阶段时,它会将这些导入自动格式化为:
from here import this
from here1 import this1
from here2 import this2
事实证明,当 saving/commiting 通过位于 [= 下的 File Watchers 功能更改时,Pycharm 自动格式化我的导入17=] 部分,禁用它有助于自动格式化。