diff --git a/README.md b/README.md index ac4caa19414..7063dec352f 100644 --- a/README.md +++ b/README.md @@ -267,6 +267,33 @@ keep it. Use [proofit404/blacken](https://github.com/proofit404/blacken). +### PyCharm + +(Adapted from [*Pylinting with PyCharm*]https://kirankoduru.github.io/python/pylint-with-pycharm.html)) + +1. Install `black`. + + $ pip install pylint + +2. Locate your `black` installation folder. + + $ which pylint # MacOS/Linux + /usr/local/bin/pylint # this is just a possible output check yours + + + + $ where pylint # Windows + %LocalAppData%\Programs\Python\Python36-32\Scripts\pylint.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: + - Arguments: $FilePath$ + +5. Format the currently opened file by selecting `Tools -> External Tools -> black`. ### Vim @@ -325,8 +352,6 @@ The formatted code will be returned on stdout (unless `--check` was passed). *Black* will still emit messages on stderr but that shouldn't affect your use case. -This can be used for example with PyCharm's [File Watchers](https://www.jetbrains.com/help/pycharm/file-watchers.html). - ## Testimonials