配置autopep8
自动将代码符合pep8规范
安装autopep8
pip install autopep8
preference >Tools>Extends Tools>add
1
2
3
4
5
6
- Name:Autopep8(可以随便取)
- Tools settings:
- Programs:`autopep8` (前提是你已经安装了哦)
- Parameters:`--in-place --aggressive --aggressive $FilePath$`
- Working directory:`$ProjectFileDir$`
- 点击Output Filters→添加,在对话框中的:Regular expression to match output中输入:`$FILE_PATH$\:$LINE$\:$COLUMN$\:.*`
使用:文件的编辑器中→右键→External Tools→点击Autopep8。
配置pylint
检测代码规范
安装pylint
pip install pylint
preference >Tools>Extends Tools>add
1
2
3
4
5
- Name:Pylint(可以随便取)
- Tools settings:
- Programs:`autopep8` (前提是你已经安装了哦)
- Parameters:`--output-format=parseable --disable=R -rn --msg-template="{abspath}:{line}: [{msg_id}({symbol}), {obj}] {msg}" $FilePath$`
- Working dirctory:`$FileDir$`
配置isort
自动管理引入包顺序
安装isort
pip install isort
preference >Tools>Extends Tools>add
1
2
3
4
5
- Name:Isort(可以随便取)
- Tools settings:
- Programs:`isort` (前提是你已经安装了哦)
- Parameters:`$FilePath$`
- Working dirctory:`$ProjectFileDir$`
设置tab为4个空格
preference -> editor -> code style -> 去掉use tab charater
开启省电模式(power save mode):会关闭代码提示功能,ctrl+space手动提示
file -> power save mode
快捷键(Mac OS X 10.5+)
command:⌘ alt:⌥ shift:⇧ ctrl:^