Skip to content

Commit

Permalink
README: Add instructions for PyCharm (#81)
Browse files Browse the repository at this point in the history
Instructions to add `black` to "External Tools" in PyCharm.

Adapted from https://kirankoduru.github.io/python/pylint-with-pycharm.html
  • Loading branch information
Stevoisiak authored and ambv committed Apr 9, 2018
1 parent 00cadd4 commit ecc2947
Showing 1 changed file with 28 additions and 0 deletions.
28 changes: 28 additions & 0 deletions README.md
Original file line number Diff line number Diff line change
Expand Up @@ -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:
Expand Down

0 comments on commit ecc2947

Please sign in to comment.