Commit Graph

672 Commits

Author SHA1 Message Date
Łukasz Langa
e44e0a6598
Compress RUN statements into one to avoid layer proliferation
Thanks for the suggestion, @imomaliev.
2020-03-17 11:33:57 +01:00
Łukasz Langa
fc804d5f59
Update dependencies 2020-03-17 11:33:02 +01:00
Max Smolens
729f2d8caf
Fix typo in README (#1306) 2020-03-12 19:42:17 +00:00
Hugo van Kemenade
3ac97a3084
Update wording and formatting (#1302) 2020-03-09 15:32:27 +00:00
Batuhan Taşkaya
9a50ba261c
Implement Black Version Gallery (#1294)
Closes #1290.
2020-03-09 14:42:26 +01:00
Abdur-Rahmaan Janhangeer
5fc9f2baab
[README.md] Updated Mail Address - Abdur-Rahmaan Janhangeer (#1301) 2020-03-09 14:38:54 +01:00
Łukasz Langa
5b552fab9d
Update the name of Mode in the reference docs, too 2020-03-04 23:19:21 +01:00
Łukasz Langa
06f2790b5c
Rename FileMode into just Mode
The mode was never just about files to begin with.  There are no other modes in
Black, this can be the default one.
2020-03-04 23:16:55 +01:00
Łukasz Langa
0626c89a5a
Document how to use format_str()
Closes #1064
2020-03-04 23:08:57 +01:00
Łukasz Langa
e253f1260d
Introduce a section of docs about exceptions 2020-03-04 22:26:45 +01:00
Łukasz Langa
4eb822f20c
Run prettier and fix whitespace on CHANGES.md (#1296) 2020-03-04 19:10:17 +01:00
Łukasz Langa
c3589afa3d
Add @cooperlees to maintainers
Fixes #1295
2020-03-04 16:57:24 +01:00
Łukasz Langa
5b6f61e765
Tell people where Change Log went 2020-03-04 16:46:20 +01:00
Cooper Lees
d29303c988
Split out Change Log (#1117)
* Split out Change Log
- Move to CHANGES.md to allow bots to see changes
- MANIFEST.in already includes *.md so CHANGES.md will be included
- THis maintains format but the change log will now be after acknowledgements
- This also ensure this gets added to pypi.org via setup.py function
2020-03-04 16:40:48 +01:00
Shantanu
6d8b90167b
string prefixes: don't normalise capital R-strings (#1271)
Resolves #1244

Co-authored-by: Łukasz Langa <lukasz@langa.pl>
2020-03-03 14:55:14 +01:00
Paul Ganssle
bbe5ae70c1
Notify users of missing Python lazily (#1210)
Currently this message shows up with no context prior to the start of
Vim. By changing this to a lazy message, the user will only be notified
of a problem with the Black plugin when they are attempting to use the
Black plugin.

Co-authored-by: Łukasz Langa <lukasz@langa.pl>
2020-03-03 13:00:52 +01:00
Tal Amuyal
8fef74cf52
Teach the Vim plugin to respect pyproject.toml (issue 414) (#1273)
Creates two separate functions:

1) abspath_pyproject_toml: find the absolute path to pyproject.toml
2) parse_pyproject_toml: finds black-specific toml config

Co-authored-by: Samuel Roeca <samuel.roeca@gmail.com>
2020-03-03 12:23:28 +01:00
Yurii Karabas
ce14fa8b49
Simplify Line.contains_multiline_strings method (#1267) 2020-02-09 21:21:46 +00:00
Shinya Fujino
383857273c Update README.md to include appropriate command to install Vim with Python 3 on macOS (#1247)
* Update README.md to include appropriate command to install Vim with Python 3 on macOS

* Run pre-commit hooks
2020-01-26 13:31:49 +00:00
Matthew Clapp
d33337b4d5 Change error message to specify its origin. (#1240) 2020-01-23 08:18:57 -08:00
Vlad Emelianov
be49ac72a0 Support py38-style starred expressions in return statement (#1121) 2020-01-18 07:21:46 -08:00
Jon Dufresne
7f5d0e9754 Remove unused variables tokenprog, Token and PlainToken (#1137) 2020-01-18 07:21:19 -08:00
Yazdan
915ebfcf7c change pyproject.toml relative path to absolute path in README.md (#1152)
because in the readthedocs hosted version this pyproject.toml will route to readthedocs does not exist page
2020-01-18 07:19:54 -08:00
Michael Aquilina
70af20eb50 Add comment to flake8 configuration explaining line-length mismatch (#1206) 2020-01-18 07:17:06 -08:00
kyle hausmann
a02829bea1 Use conditional case for diff reports (#1226)
When --diff flag is used, black will now use the
conditional case in the Report output: eg "would
be reformatted"
2020-01-18 07:13:15 -08:00
Mr. Outis
9ef8e6c9b0 bump regex version, providing wheels (#1232)
Close #1112
2020-01-18 07:12:24 -08:00
hauntsaninja
1ab87a3f67 find_project_root: allow .git to be a file (#1217)
Fixes #1213
2020-01-02 14:33:30 -08:00
Hugo van Kemenade
7af619b8c1 Skip the broken version of regex (#1209) 2019-12-16 13:46:43 -08:00
Hugo van Kemenade
1a5b55cf2d This MANIFEST.in not needed with setuptools_scm (#1200) 2019-12-11 02:23:26 -08:00
Francisco
ac10ca8e60 Add Thonny-black-code-format plugin (#1195) 2019-12-08 10:13:50 -08:00
Cooper Lees
b69bce860c Add GitHub Actions badge to README.md (#1134) 2019-12-04 00:33:25 -08:00
Zsolt Dollenstein
b7624cedb9
Fix list literal example in README
The literal as written is going to be exploded because of the trailing comma.
2019-11-30 11:16:33 +00:00
springstan
5e9244ea0d Add Home Assistant to 'Used by' section (#1182)
See the following post: https://developers.home-assistant.io/blog/2019/07/31/black.html
2019-11-29 06:19:36 -08:00
Michael J. Sullivan
4b449e7471 Fix unstable formatting with some # type: ignores (#1113)
`type: ignore` shouldn't block collapsing a line, since it will still
apply fine to the merged line. This prevents an issue where a reformat
causes it to shift lines and then be merged on a subsequent pass.

There is a downside to this, which is that it can cause a `type:
ignore` to apply to more code than was originally intended. There
might be a way to apply this in a more limited situation, but I'm not
sure what it is.

Fixes #1061.
2019-11-25 14:16:00 -08:00
Denis Laxalde
fb1ac69812 Simple docs cleanup (#1168)
* Remove reference to format_int_string in docs

The function got dropped in 250ba7f04b.

* Remove reference to is_python36 in docs

The function got removed in 36d3c516d3.
2019-11-22 20:38:46 -08:00
Hugo van Kemenade
c53853f571 CI: Add Python 3.8 and lint to GitHub Actions (#1173)
* CI: Test Python 3.8 on GitHub Actions

* pre-commit autoupdate

* CI: Lint on GitHub Actions
2019-11-22 08:14:57 +00:00
Anthony Sottile
fa1163545f Suggest extend-ignore over ignore for flake8 (#1165)
this option was introduced in flake8 3.7.x and is generally preferred over `ignore` (which unsets all default ignores)
2019-11-22 08:13:23 +00:00
Tim Gates
de6f4b1f6b Fix simple typo: intput -> input (#1146)
Fixes #1147
2019-11-07 12:57:39 -08:00
Richard Fearn
9b484d1bcc Remove duplicate paragraph about blackd headers (#1124) 2019-10-30 17:20:27 -07:00
Michael J. Sullivan
3e60f6d454 Support compilation with mypyc (#1009)
* Make most of blib2to3 directly typed and mypyc-compatible

This used a combination of retype and pytype's merge-pyi to do the
initial merges of the stubs, which then required manual tweaking to
make actually typecheck and work with mypyc.

Co-authored-by: Sanjit Kalapatapu <sanjitkal@gmail.com>
Co-authored-by: Michael J. Sullivan <sully@msully.net>

* Make black able to compile and run with mypyc

The changes made fall into a couple categories:
 * Fixing actual type mistakes that slip through the cracks
 * Working around a couple mypy bugs (the most annoying of which being
   that we need to add type annotations in a number of places where
   variables are initialized to None)

Co-authored-by: Sanjit Kalapatapu <sanjitkal@gmail.com>
Co-authored-by: Michael J. Sullivan <sully@msully.net>
2019-10-30 07:29:29 -07:00
Thomas Grainger
12826f3c1e replace broken rtfd pypi badge (#1120) 2019-10-30 07:27:20 -07:00
Michael J. Sullivan
31f4105731 Switch from attrs to dataclasses (#1116)
The main motivation here is that mypyc is going to have custom support
for dataclasses but probably not attrs.
2019-10-29 21:06:34 -07:00
Łukasz Langa
6bedb5c58a
Remove Poetry metadata 2019-10-28 23:02:39 +01:00
Hugo van Kemenade
6140f04fe1 Test Windows, macOS and Linux on GitHub Actions (#1085) 2019-10-28 21:00:43 +01:00
Łukasz Langa
f2203a77c5
acks += llchan 2019-10-28 20:58:06 +01:00
Lawrence Chan
23fec8b0f7 Fix fmt on/off when multiple exist in leaf prefix (#1086)
The old behavior would detect the existence of a `# fmt: on` in a leaf
node's comment prefix and immediately mark the node as formatting-on,
even if a subsequent `# fmt: off` in the same comment prefix would turn
it back off. This change modifies that logic to track the state through
the entire prefix and take the final state.

Note that this does not fully solve on/off behavior, since any _comment_
lines between the off/on are still formatted. We may need to add
virtual leaf nodes to truly solve that. I will leave that for a separate
commit/PR.

Fixes #1005
2019-10-28 20:51:45 +01:00
Łukasz Langa
f99fad1b78
Always move the prefix out when wrapping with parentheses (#1103)
Fixes #1097
2019-10-28 20:34:37 +01:00
Łukasz Langa
32009775e5
Restore simple form of if statement 2019-10-28 19:39:48 +01:00
Łukasz Langa
c1fe3aa4f8
Simplify some code flow
Put empty lines after control flow changes.
2019-10-28 17:44:30 +01:00
Łukasz Langa
0cf0d68cf2
Explicitly close .gitignore during processing 2019-10-28 17:42:46 +01:00