added instructions for PyCharm File Watcher setup (#418)
* added instructions for PyCharm File Watcher setup With these steps, PyCharm will run black on every file save. * Update README.md
This commit is contained in:
parent
2ec4c5f4f9
commit
450983e333
13
README.md
13
README.md
@ -619,11 +619,22 @@ $ where black
|
||||
- Name: Black
|
||||
- Description: Black is the uncompromising Python code formatter.
|
||||
- Program: <install_location_from_step_2>
|
||||
- Arguments: $FilePath$
|
||||
- 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 -> External Tools -> External Tools - Black`.
|
||||
|
||||
6. Optionally, run Black on every file save:
|
||||
|
||||
1. Make sure you have the [File Watcher](https://plugins.jetbrains.com/plugin/7177-file-watchers) plugin installed.
|
||||
2. Go to `Preferences -> Tools -> File Watchers` and click `+` to add a new watcher:
|
||||
- Name: Black
|
||||
- File type: Python
|
||||
- Scope: Project Files
|
||||
- Program: <install_location_from_step_2>
|
||||
- Arguments: `$FilePath$`
|
||||
- Output paths to refresh: `$FilePathRelativeToProjectRoot$`
|
||||
- Working directory: `$ProjectFileDir$`
|
||||
|
||||
### Vim
|
||||
|
||||
|
Loading…
Reference in New Issue
Block a user