README: Add instructions for PyCharm (#81)

Instructions to add `black` to "External Tools" in PyCharm.

Adapted from https://kirankoduru.github.io/python/pylint-with-pycharm.html
This commit is contained in:
Steven M. Vascellaro 2018-04-09 15:00:37 -04:00 committed by Łukasz Langa
parent 00cadd43ee
commit ecc294741e

View File

@ -308,6 +308,34 @@ you should tell Flake8 to ignore these warnings.
Use [proofit404/blacken](https://github.com/proofit404/blacken).
### PyCharm
1. Install `black`.
$ pip install black
2. Locate your `black` installation folder.
$ which black # MacOS/Linux
/usr/local/bin/black # possible location
<!-->
$ where black # Windows
%LocalAppData%\Programs\Python\Python36-32\Scripts\black.exe # possible location
3. Open External tools in PyCharm with `File -> Settings -> Tools -> External Tools`.
4. Click the + icon to add a new external tool with the following values:
- Name: Black
- Description: Black is the uncompromising Python code formatter.
- Program: <install_location_from_step_2>
- Arguments: $FilePath$
5. Format the currently opened file by selecting `Tools -> External Tools -> black`.
- Alternatively, you can set a keyboard shortcut by navigating to `Preferences -> Keymap`.
### Vim
Commands and shortcuts: