Skip to content
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

Merged
merged 8 commits into from
Apr 9, 2018
Merged

Conversation

Stevoisiak
Copy link
Contributor

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

Adapted from https://kirankoduru.github.io/python/pylint-with-pycharm.html

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

Adapted from https://kirankoduru.github.io/python/pylint-with-pycharm.html
@coveralls
Copy link

Pull Request Test Coverage Report for Build 114

  • 0 of 0 (NaN%) changed or added relevant lines in 0 files are covered.
  • No unchanged relevant lines lost coverage.
  • Overall coverage remained the same at 88.705%

Totals Coverage Status
Change from base Build 113: 0.0%
Covered Lines: 1123
Relevant Lines: 1266

💛 - Coveralls

1 similar comment
@coveralls
Copy link

Pull Request Test Coverage Report for Build 114

  • 0 of 0 (NaN%) changed or added relevant lines in 0 files are covered.
  • No unchanged relevant lines lost coverage.
  • Overall coverage remained the same at 88.705%

Totals Coverage Status
Change from base Build 113: 0.0%
Covered Lines: 1123
Relevant Lines: 1266

💛 - Coveralls

@coveralls
Copy link

coveralls commented Mar 27, 2018

Pull Request Test Coverage Report for Build 188

  • 0 of 0 (NaN%) changed or added relevant lines in 0 files are covered.
  • 122 unchanged lines in 2 files lost coverage.
  • Overall coverage increased (+1.7%) to 90.42%

Files with Coverage Reduction New Missed Lines %
tests/test_black.py 3 97.72%
black.py 119 88.24%
Totals Coverage Status
Change from base Build 113: 1.7%
Covered Lines: 1378
Relevant Lines: 1524

💛 - Coveralls

@ambv
Copy link
Collaborator

ambv commented Mar 27, 2018

Thanks for your contribution! It looks like your guide still says "pylint" in lots of places.

@Stevoisiak
Copy link
Contributor Author

Stevoisiak commented Mar 27, 2018

@ambv Good catch. I've fixed the instances of "pylint" (feel free to squash before merging).

Copy link
Collaborator

@ambv ambv left a 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).
Copy link
Collaborator

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))
Copy link
Collaborator

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.

Copy link

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`.
Copy link
Collaborator

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
Copy link
Collaborator

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
Copy link
Collaborator

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.
Copy link
Collaborator

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`.

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

Copy link

Choose a reason for hiding this comment

The reason will be displayed to describe this comment to others. Learn more.

Copy link
Contributor Author

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.

@sfdye
Copy link

sfdye commented Apr 9, 2018

Exactly what I am looking for, please get it merged soon!

@Stevoisiak
Copy link
Contributor Author

@ambv @sfdye I have updated my PR with the requested changes.

@ambv ambv merged commit ecc2947 into psf:master Apr 9, 2018
@ambv
Copy link
Collaborator

ambv commented Apr 9, 2018

Thanks! ✨ 🍰 ✨

@Stevoisiak Stevoisiak deleted the readme-pycharm branch April 10, 2018 13:47
Sign up for free to join this conversation on GitHub. Already have an account? Sign in to comment
Labels
None yet
Projects
None yet
Development

Successfully merging this pull request may close these issues.

None yet

5 participants