X-Git-Url: https://git.madduck.net/etc/vim.git/blobdiff_plain/4b8669f5029a5ef6621bbbe0052ac85f278ba4d3..915ebfcf7cabdf0e7e0074b24441c05093286050:/README.md diff --git a/README.md b/README.md index 8dceeac..cd4a475 100644 --- a/README.md +++ b/README.md @@ -4,10 +4,11 @@

Build Status +Actions Status Documentation Status Coverage Status License: MIT -PyPI +PyPI Downloads Code style: black

@@ -162,7 +163,7 @@ statement per line. If this fits the allotted line length, great. j = [1, 2, - 3, + 3 ] # out: @@ -284,6 +285,14 @@ curious about the reasoning behind B950, explains it. The tl;dr is "it's like highway speed limits, we won't bother you if you overdo it by a few km/h". +**If you're looking for a minimal, black-compatible flake8 configuration:** + +```ini +[flake8] +max-line-length = 88 +extend-ignore = E203 +``` + ### Empty lines _Black_ avoids spurious vertical whitespace. This is in the spirit of PEP 8 which says @@ -772,6 +781,10 @@ hook global WinSetOption filetype=python %{ } ``` +### Thonny + +Use [Thonny-black-code-format](https://github.com/Franccisco/thonny-black-code-format). + ### Other editors Other editors will require external contributions. @@ -849,6 +862,8 @@ The headers controlling how code is formatted are: a set of comma-separated Python versions, optionally prefixed with `py`. For example, to request code that is compatible with Python 3.5 and 3.6, set the header to `py3.5,py3.6`. +- `X-Diff`: corresponds to the `--diff` command line flag. If present, a diff of the + formats will be output. If any of these headers are set to invalid values, `blackd` returns a `HTTP 400` error response, mentioning the name of the problematic header in the message body. @@ -885,7 +900,9 @@ Then run `pre-commit install` and you're ready to go. Avoid using `args` in the hook. Instead, store necessary configuration in `pyproject.toml` so that editors and command-line usage of Black all behave consistently -for your project. See _Black_'s own [pyproject.toml](/pyproject.toml) for an example. +for your project. See _Black_'s own +[pyproject.toml](https://github.com/psf/black/blob/master/pyproject.toml) for an +example. If you're already using Python 3.7, switch the `language_version` accordingly. Finally, `stable` is a tag that is pinned to the latest release on PyPI. If you'd rather run on @@ -918,7 +935,7 @@ then write the above files to `.cache/black//`. The following notable open-source projects trust _Black_ with enforcing a consistent code style: pytest, tox, Pyramid, Django Channels, Hypothesis, attrs, SQLAlchemy, Poetry, PyPA applications (Warehouse, Pipenv, virtualenv), pandas, Pillow, every Datadog -Agent Integration. +Agent Integration, Home Assistant. Are we missing anyone? Let us know. @@ -1001,6 +1018,9 @@ More details can be found in [CONTRIBUTING](CONTRIBUTING.md). - fixed feature detection for trailing commas in function definitions and call sites (#763) +- `# fmt: off`/`# fmt: on` comment pairs placed multiple times within the same block of + code now behave correctly (#1005) + - _Black_ no longer crashes on Windows machines with more than 61 cores (#838) - _Black_ no longer crashes on standalone comments prepended with a backslash (#767) @@ -1034,6 +1054,9 @@ More details can be found in [CONTRIBUTING](CONTRIBUTING.md). - `blackd` now returns the version of _Black_ in the response headers (#1013) +- `blackd` can now output the diff of formats on source code when the `X-Diff` header is + provided (#969) + ### 19.3b0 - new option `--target-version` to control which Python versions _Black_-formatted code @@ -1464,6 +1487,7 @@ Multiple contributions by: - [Josh Bode](mailto:joshbode@fastmail.com) - [Juan Luis Cano Rodríguez](mailto:hello@juanlu.space) - [Katie McLaughlin](mailto:katie@glasnt.com) +- Lawrence Chan - [Linus Groh](mailto:mail@linusgroh.de) - [Luka Sterbic](mailto:luka.sterbic@gmail.com) - Mariatta