Python versions that should be supported by
Black's output. [default: per-file auto-
detection]
+ --py36 Allow using Python 3.6-only syntax on all
+ input files. This will put trailing commas
+ in function signatures and calls also after
+ *args and **kwargs. Deprecated; use
+ --target-version instead. [default: per-file
+ auto-detection]
--pyi Format all input files like typing stubs
regardless of file extension (useful when
piping source on standard input).
Use [proofit404/blacken](https://github.com/proofit404/blacken).
-### PyCharm
+### PyCharm/IntelliJ IDEA
1. Install `black`.
%LocalAppData%\Programs\Python\Python36-32\Scripts\black.exe # possible location
```
-3. Open External tools in PyCharm with `File -> Settings -> Tools -> External Tools`.
+3. Open External tools in PyCharm/IntelliJ IDEA
+
+ On macOS:
+
+```PyCharm -> Preferences -> Tools -> External Tools```
+
+ On Windows / Linux / BSD:
+
+```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$`
+ - 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`.
+ - Alternatively, you can set a keyboard shortcut by navigating to `Preferences or Settings -> 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:
+ 2. Go to `Preferences or Settings -> Tools -> File Watchers` and click `+` to add a new watcher:
- Name: Black
- File type: Python
- Scope: Project Files
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).
+This can be used for example with PyCharm's or IntelliJ's [File Watchers](https://www.jetbrains.com/help/pycharm/file-watchers.html).
## blackd
## Change Log
+### 19.3b1
+
+* fix bug that led *Black* format some code with a line length target of 1
+ (#762)
+
### 19.3b0
* new option `--target-version` to control which Python versions
*Black*-formatted code should target (#618)
-* removed `--py36` (use `--target-version=py36` instead) (#724)
+* deprecated `--py36` (use `--target-version=py36` instead) (#724)
* *Black* no longer normalizes numeric literals to include `_` separators (#696)
* long `del` statements are now split into multiple lines (#698)
+* type comments are no longer mangled in function signatures
+
* improved performance of formatting deeply nested data structures (#509)
+* *Black* now properly formats multiple files in parallel on
+ Windows (#632)
+
+* *Black* now creates cache files atomically which allows it to be used
+ in parallel pipelines (like `xargs -P8`) (#673)
+
+* *Black* now correctly indents comments in files that were previously
+ formatted with tabs (#262)
+
* `blackd` now supports CORS (#622)
### 18.9b0
* [Peter Bengtsson](mailto:mail@peterbe.com)
* [Stavros Korokithakis](mailto:hi@stavros.io)
* [Sunil Kapil](mailto:snlkapil@gmail.com)
+* [Utsav Shah](mailto:ukshah2@illinois.edu)
* [Vishwas B Sharma](mailto:sharma.vishwas88@gmail.com)
* [Chuck Wooters](mailto:chuck.wooters@microsoft.com)