Yapf is a formatter for Python files developed by Google. It can help you automatiaccally format the code.
Open your terminal / cmd run the following command:
pip install yapf
-
Configuration
- Name:Yapf (Whatever name)
- Tools settings:
Programs:yapf (Make sure you have installed)
Parameters: -i $FilePath$
Working directory: $ProjectFileDir$
Output filters: $FILE_PATH$\:$LINE$\:$COLUMN$\:.*
- Open External Tools keymap:
Preference → Keymap → External Tools → External Tools -> Yapf
` - Add Keyboard shortcut
-
From menu:
External Tools → Yapf
-
Keyboard shortcut
Alt + F