Commit ecc29474 authored by Steven M. Vascellaro's avatar Steven M. Vascellaro Committed by Łukasz Langa
Browse files

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
parent 00cadd43
Loading
Loading
Loading
Loading
+28 −0
Changes for README.md: 28 added lines, 0 removed lines.
Original line number Diff line number Diff line
@@ -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: