-
Notifications
You must be signed in to change notification settings - Fork 2.4k
New issue
Have a question about this project? Sign up for a free GitHub account to open an issue and contact its maintainers and the community.
By clicking “Sign up for GitHub”, you agree to our terms of service and privacy statement. We’ll occasionally send you account related emails.
Already on GitHub? Sign in to your account
README: Add instructions for PyCharm #81
Conversation
Instructions to add `black` to "External Tools" in PyCharm. Adapted from https://kirankoduru.github.io/python/pylint-with-pycharm.html
Pull Request Test Coverage Report for Build 114
💛 - Coveralls |
1 similar comment
Pull Request Test Coverage Report for Build 114
💛 - Coveralls |
Pull Request Test Coverage Report for Build 188
💛 - Coveralls |
Thanks for your contribution! It looks like your guide still says "pylint" in lots of places. |
@ambv Good catch. I've fixed the instances of "pylint" (feel free to squash before merging). |
There was a problem hiding this comment.
Choose a reason for hiding this comment
The reason will be displayed to describe this comment to others. Learn more.
Alright, this is very nice. I just have some slight wording adjustements. See comments.
README.md
Outdated
@@ -325,8 +354,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). |
There was a problem hiding this comment.
Choose a reason for hiding this comment
The reason will be displayed to describe this comment to others. Learn more.
Don't remove this. File Watchers is a distinct and also useful integration if somebody wants to format on save.
README.md
Outdated
@@ -268,6 +268,35 @@ 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)) |
There was a problem hiding this comment.
Choose a reason for hiding this comment
The reason will be displayed to describe this comment to others. Learn more.
I understand why you want to share credit but I think the steps outlined below are generic enough that you don't have to. This just adds noise to the guide.
There was a problem hiding this comment.
Choose a reason for hiding this comment
The reason will be displayed to describe this comment to others. Learn more.
I agree with @ambv on this point
README.md
Outdated
|
||
(Adapted from [*Pylinting with PyCharm*](https://kirankoduru.github.io/python/pylint-with-pycharm.html)) | ||
|
||
1. Install `black`. |
There was a problem hiding this comment.
Choose a reason for hiding this comment
The reason will be displayed to describe this comment to others. Learn more.
nit: In all of the docs when we refer to the project, we say *Black*
, not `black`.
README.md
Outdated
2. Locate your `black` installation folder. | ||
|
||
$ which black # MacOS/Linux | ||
/usr/local/bin/black # this is just a possible output check yours |
There was a problem hiding this comment.
Choose a reason for hiding this comment
The reason will be displayed to describe this comment to others. Learn more.
I like the simple comment you used for the Windows version: # possible location
.
README.md
Outdated
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 |
There was a problem hiding this comment.
Choose a reason for hiding this comment
The reason will be displayed to describe this comment to others. Learn more.
Capital B.
README.md
Outdated
|
||
4. Click the + icon to add a new external tool with the following values: | ||
- Name: black | ||
- Description: Black is the uncompromising Python code formatter. |
There was a problem hiding this comment.
Choose a reason for hiding this comment
The reason will be displayed to describe this comment to others. Learn more.
"Black is" is redundant. "The uncompromising Python code formatter." is enough.
- Program: <install_location_from_step_2> | ||
- Arguments: $FilePath$ | ||
|
||
5. Format the currently opened file by selecting `Tools -> External Tools -> black`. |
There was a problem hiding this comment.
Choose a reason for hiding this comment
The reason will be displayed to describe this comment to others. Learn more.
I would also add instructions on how to map it as a keymap. (You can simply do it through the regular keymap settings). It'll be there in External Tools
There was a problem hiding this comment.
Choose a reason for hiding this comment
The reason will be displayed to describe this comment to others. Learn more.
I would simply link this guide: https://blog.jetbrains.com/webstorm/2016/08/using-external-tools/
There was a problem hiding this comment.
Choose a reason for hiding this comment
The reason will be displayed to describe this comment to others. Learn more.
I have added the instructions as a bullet point on the next line.
Exactly what I am looking for, please get it merged soon! |
Thanks! ✨ 🍰 ✨ |
Instructions to add
black
to "External Tools" in PyCharm.Adapted from https://kirankoduru.github.io/python/pylint-with-pycharm.html