Commit Graph

393 Commits

Author SHA1 Message Date
David W.H. Swenson
3e3da8eef6
Fix GitHub markdown links to work on RTD (#1752)
* Fix internal links to work on RTD

Note that these still lead to GitHub, instead of staying on RTD.

* Point links to better anchors
2020-10-18 14:27:15 -07:00
Hadi Alqattan
4d6a84a829
Allow black's Github action params overriding. (#1755)
* Allow default params overriding.

* Update: docs and action.yaml.

* The second contirbution, add my name to authors.md

* Correct docs `with.args` example.

* Just to rerun the Travis jobs.

* chmod 755
2020-10-18 14:24:33 -07:00
Hadi Alqattan
dd2f86ac0a
Support stable Python3.9. (#1748)
* Support stable Python3.9.

* Get back to 3.9-dev

* Add py39 to black usage.

* remove 3.9 temporarily.
2020-10-08 14:13:13 -07:00
Cha Gyuseok
d9884b6d33
docs: update used-by link to proper url (#1745) 2020-10-07 07:45:06 -07:00
Pete Grayson
4d71d74a44
Repair colorama wrapping on non-Windows platforms (#1670)
* Repair colorama wrapping on non-Windows platforms

The wrap_stream_for_windows() function calls
colorama.initialise.wrap_stream() function to apply colorama's magic to
wrapper to the output stream. Except this wrapper is only applied on
Windows platforms that need it, otherwise the original stream is
returned as-is.

The colorama wrapped stream lacks a detach() method, so a no-op lambda
was being assigned to the wrapped stream.

The problem is that the no-op lambda was being assigned unconditionally
whether or not colorama actually returns a wrapped stream, thus
replacing the original TextIOWrapper's detach() method. Replacing the
detach() method with a no-op lambda is the root cause of the problem
observed in #1664.

The solution is to only assign the no-op detach() method if the stream
lacks its own detach() method.

Repairs #1664
2020-09-27 22:41:11 +01:00
Vipul
bc138d1263
End 'force-exclude' help message with a period (#1727)
It would be nice, if like other options help message, force-exclude's
help message also ends with a period punctuation mark.
2020-09-27 07:54:21 +02:00
Michael Wilkinson
1e8916f450
Add link to conda-forge integration (#1687)
* Add link to conda-forge integration

resolves #1686

* README: keep PyPI tags together

Co-authored-by: Hugo van Kemenade <hugovk@users.noreply.github.com>
2020-09-08 09:42:57 -07:00
Zac-HD
cd3a93a146 Property-based fuzz test 2020-08-21 16:47:49 +02:00
Richard Si
37a0020e07
Upgrade docs to Sphinx 3+ and add doc build test (#1613)
* Upgrade docs to Sphinx 3+
* Fix all the warnings...

- Fixed bad docstrings
- Fixed bad fenced code blocks in documentation
- Blocklisted some sections from being generated from the README
- Added missing documentation to index.rst
- Fixed an invalid autofunction directive in reference/reference_functions.rst
- Pin another documentation dependency

* Add documentation build test
2020-08-21 00:06:41 +02:00
Daanyaal Syed
80425ca440
Fix inline code style in README (#1608)
Refer to `pyproject.toml` in HTML section of README with HTML code tags
2020-08-17 11:55:38 -07:00
Chris Rose
149b38d674
Add the direnv base directory to the default excludes (#1564)
Co-authored-by: Chris Rose <offline@offby1.net>
2020-08-12 19:28:01 -07:00
Kaligule
b59a524657
fix spelling (#1567)
Co-authored-by: Hugo van Kemenade <hugovk@users.noreply.github.com>
2020-08-01 14:21:55 -07:00
Vinicius Gubiani Ferreira
2c5041cfa0
docs: Improve pre-commit use (#1551)
Stable tag wasn't available and crashed when attempting to set initial
pre-commit. Also the python version needs to be installed so it would
be better to use the generic "python3" command.
2020-07-15 21:51:39 -07:00
Olexiy
cc2facaac6
ISSUE 1533: Fix --config argument description (#1534)
Change --config argument description to "Read configuration from FILE."
The "--config FILE                   Read configuration from FILE path"
2020-07-08 08:51:18 -07:00
Jelle Zijlstra
11f130b7de
add Quora to orgs that use Black (#1532) 2020-07-06 12:45:13 -07:00
Sylvestre Ledru
3209bf7ffa
Mozilla uses black too (#1531) 2020-07-06 07:06:34 -07:00
Cooper Lees
81a093e82a
Add pip install from GitHub command to README.md (#1529)
* Add pip install from GitHub command to README.md
* Make it prettier ...
2020-07-01 08:15:24 -07:00
Richard Si
d3cc63316b
Add missing contributors to README.md (Thank you everyone!) (#1508)
Black wouldn't be where it is without the countless outside contributions.
So thank you y'all and we will share our appreciation by listing your names
(and emails) in the README.md :D
2020-06-18 11:54:02 +01:00
Hugo Barrera
fcf9796106
GitHub action (#1421)
* Implement a re-usable GitHub Action

Implement a GitHub action that can be reused across projects that want
to run black as part of their CI workflows.

* Fix typo in README.md

Co-authored-by: Hugo van Kemenade <hugovk@users.noreply.github.com>

* Use latest Python 3

Co-authored-by: Hugo van Kemenade <hugovk@users.noreply.github.com>
2020-06-01 11:11:49 -07:00
Richard Si
34613383ab
Make 'python -m black' work (#1460) 2020-05-26 19:42:07 -07:00
Richard Si
7403d95862
Refactor docs / Maintenance of docs (#1456)
* Split code style and components documentation

Splits 'the_black_code_style', 'pragmatism', 'blackd',and 'black_primer'
into their own files. The exception being 'the_black_code_style' and
'pragmatism'. They have been merged into one 'the_black_code_style_and_pragmatism'
file.

These changes are being made because the README is becoming very long. And
a README isn't great if it dissuades its reader because of its length.

* Update the doc generation logic and configuration

With the moving of several sections in the README and the renaming of a
few files, 'conf.py' needs to be able to support custom sections.

This commit introduces DocSection which can be used to specify custom
sections of documentation. The information stored in DocSection will be
used by the process_sections function to read, process, and write the section
to CURRENT_DIR.

A large change has been made to the how the docs are prepared to be built.
Instead of just generating the files needed by reading the README, this
has a full chain of operations so custom sections are supported. First,
it reads the README and spits out a list of DocSection objects representing
the sections to be generated by process_sections. This is done since most
of the docs still live in README. Then along with the defined custom_sections
, the process_sections will be begin to process the DocSection objects.
It reads the information it needs to generate the section. Then fetches
the section's contents, calls processors required by the section to process
the section's contents, and finally writes the section to CURRENT_DIR.

This large change is so processing of the documentation can be done just
for the versions hosted on ReadTheDocs.org. An example processor using this
feature is a 'replace_links' processor. It will replace documentation
links that point to the docs hosted on GitHub with links that point to the
version hosted on ReadTheDocs.org. (I won't be coding that ATM)

This also means that files will be overwritten or created once the docs
have been built. It is annoying, since you have to 'git reset --hard'
and 'git clean -f -d' after each build, but there's nothing better. The old
system had the same side effects, so yeah :(

* Update filenames and delete unnecessary files

Update the filenames since 'the_black_code_style' and 'pragmatism' were
merged and 'contributing' was deleted in favor of 'contributing_to_black'.

All symlinks were deleted since their home (_build/generated) is no longer
used.

* Fix broken links and a few redirections

* Merge master into refactor_docs (manually done)

* Add my and most of @hugovk suggestions

Co-Authored-By: Hugo van Kemenade <hugovk@users.noreply.github.com>

* Add logging and improve configurability

Just some cleaning up up of the DocSection dataclass and added logging
support so you know what's going on.

* Rename a section and please the grammar gods of Black

Thanks @hugovk for the suggestion!

* Fix Markdown comments

* Add myself as an author :P

Seems like the right time.

Co-authored-by: Hugo van Kemenade <hugovk@users.noreply.github.com>
2020-05-24 09:37:46 -07:00
Richard Si
0196437f8e
Scrollable sidebar (#1457)
* Make the sidebar navigation scrollable

This is necessary since we have so many documentation sections that even
on a desktop screen, the navigation can sometimes be clipped. The only
annoyance is that on Firefox, the scrollbar can't be hidden :(

* allow the docs to build
2020-05-23 11:56:50 -07:00
Cooper Lees
c77cb7b97e
Add Primer badge to README.md (#1454) 2020-05-22 12:15:41 -07:00
Gustavo Camargo
397b16431e
Update README.md (#1453) 2020-05-22 11:37:34 -07:00
Hugo van Kemenade
a2408b3cb2
black-primer: handle singular and plural in output messages (#1432)
* Handle singular and plural in output messages
2020-05-20 21:03:51 -07:00
Gustavo Camargo
bb767863b0
Update README.md (#1439) 2020-05-20 20:50:16 -07:00
Cooper Lees
b0f3798aab
Add black-primer docs (#1427)
* Add `black-primer` docs

- Document the idea, CLI args, config and a example run for `black-primer` in README.md
- Add to docs/index.rst

* Add @hugovk suggestions - Thanks.
2020-05-18 07:25:40 -07:00
Richard Si
f62f1ddc2f
Update docs about stable tag now being a branch (#1422)
* Update docs about stable tag now being a branch

Issue #760 had the `stable` tag changed to a branch since it was causing a few issues. This updates the docs to reflect that change.

* Make the prettier hook pass

* Improve wording
2020-05-17 12:19:52 -07:00
Hugo van Kemenade
435dc7d995
Fix typos (#1423) 2020-05-17 07:17:31 -07:00
Richard Si
12e857f24c
Document git's ignore-revs-file feature (#1419)
* Document git's ignore-revs-file feature

A long-standing counterargument against moving to automated code formatters
like Black is that the migration will clutter up the output of git blame.
This used to be a valid argument, but not anymore. Since git version 2.23,
git natively supports ignoring revisions in blame with the --ignore-rev
and --ignore-revs-file options.

This isn't documented in the Black documentation. It should be as it would
put old projects wanting to migrate to Black at ease since blame won't
be ruined.

* Add links so people can +1 on --ignore-revs-file support

* Fix wording

'Counterargument' was the wrong word since it means an objection to an objection. 'Argument' is the proper word I was looking for.

Co-authored-by: Cooper Lees <me@cooperlees.com>
2020-05-16 13:22:46 -07:00
Richard Si
97060a4f18
Expand docs about slice formatting (#1418)
Black will apply no spaces around ':' operators for 'simple' expresssions
, but will apply extra space around ':' operators for 'complex' expressions.
Black treats anything more than variable names as 'complex', but this isn't
noted in the Black documentation. Which leads to a few issues on the GitHub
issue tracker that all report inconsistent spacing around ':' operators.
2020-05-16 10:21:31 +01:00
Sanket Dasgupta
f6393a20fc
Add preference of parantheses over backslashes in docs (#1399)
Closes https://github.com/psf/black/issues/392

Revived from https://github.com/psf/black/pull/558

Relevant to https://github.com/psf/black/issues/664
2020-05-09 06:32:29 -07:00
Hugo van Kemenade
4501f22fcb
README/CHANGES: Fix links (#1397)
* Replace relative README links with absolutes, so they work on PyPI

* CHANGES: Fix Spyder web link
2020-05-08 12:14:27 -07:00
shaoran
0721f11731
Adding documentation to the README for import errors in vim (#1317)
* Adding documentation to the README for import errors in vim

I had the same issue as psf/black#1148 and have been searching for a
solution to this. I realized that you cannot fix it by change anything
in the code, but by re-compiling the C extensions of regex and
typed-ast. Installing this packages from the tarballs solves the
problem.

* Fixing a bad copy&paste

Co-Authored-By: Hugo van Kemenade <hugovk@users.noreply.github.com>

* chore: changed made by pre-commit

* chore: better way of dealing with non-binary installs

* chore: adding vim cache files to the ignore list

Co-authored-by: Hugo van Kemenade <hugovk@users.noreply.github.com>
2020-05-08 08:42:19 -07:00
Dan Davison
2da2c15b21
Add purcell/reformatter.el as an Emacs integration option (#1330) 2020-05-08 16:31:06 +01:00
Jelle Zijlstra
702e459176
Update changelog and README (#1392)
* add two CHANGELOG entries

* update README on command-line options
2020-05-08 07:55:57 -07:00
Hugo van Kemenade
8e38b6626b
Remove deprecated --py36 option (#1236) 2020-05-08 07:47:54 -07:00
Richard Si
8c3c190f99
Add Black compatible configurations in documentation (#1366 & #1205) (#1371)
* Add Black compatible configs in docs ( #1366 & #1205)

When users of Black are starting a new project or are adding Black to their
existing projects, they will usually have to config their existing tools like
flake8 to be compatible with Black. Usually, these configs are the same across
different projects. Yet, there isn't any consolidated infomation on what configs
are compatible. Leaving users of Black to dig out any infomation they can find
in README.md.

* Fix a bad max-line-length value

* Clean up pylint's configs

* Add explanations for each configurations

Copying and pasting code without understanding it is a bad idea. This goes the same
for users copying and pasting configurations.

* Capitalize Pylint

* Link from the README

* Fix the isort configuration

I referenced the wrong source. I used a pesonal configuration, not a pure Black-
compatible configuration.

* Improve the config explanations

The explanation for the isort configuration was pretty bad. After having fixed the
configuration (see commit 01c55d1), improving the its explanation was necessary to
make it more user-friendly and understandable. Also added fenced code blocks of the
raw configuration options so the explanations make sense.

* Improve README wording slightly

* Add @hugovk, @JelleZijlstra + my suggestions

Co-authored-by: Cooper Lees <cooper@fb.com>
2020-05-08 07:26:29 -07:00
Arnav Borborah
6695fd892f
Include an easier way to integrate black with Pycharm (#1268)
* Include an easier way to integrate black with Pycharm
2020-05-08 15:13:57 +01:00
utsav-dbx
4041c560ec
Add Dropbox as a user of Black (#1335) 2020-05-08 15:23:22 +02:00
shaoran
8126b4f6a9
Fixing the documentation of how to install the vim plugin (#1318)
* fix: Fixing the documentation of how to install the vim plugin

Solves the installation problem that currently exist because
the current master branch is not stable. See psf/black#1304 for
more information.

* fix: fixing incorrect path
2020-04-23 19:32:40 -07:00
Quentin Pradet
7e4c6bf71f
Add missing separator in README (#1320) 2020-03-27 10:28:10 -07:00
Max Smolens
729f2d8caf
Fix typo in README (#1306) 2020-03-12 19:42:17 +00:00
Abdur-Rahmaan Janhangeer
5fc9f2baab
[README.md] Updated Mail Address - Abdur-Rahmaan Janhangeer (#1301) 2020-03-09 14:38:54 +01:00
Łukasz Langa
e253f1260d
Introduce a section of docs about exceptions 2020-03-04 22:26:45 +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
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
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
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
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
Richard Fearn
9b484d1bcc Remove duplicate paragraph about blackd headers (#1124) 2019-10-30 17:20:27 -07:00
Thomas Grainger
12826f3c1e replace broken rtfd pypi badge (#1120) 2019-10-30 07:27:20 -07:00
Łukasz Langa
f2203a77c5
acks += llchan 2019-10-28 20:58:06 +01:00
Joe Antonakakis
df6e1a41f7 Add diff support to blackd (#969) 2019-10-28 14:25:26 +01:00
Łukasz Langa
4b8669f502
Put missing contributors in the list (THANKS!) 2019-10-28 13:34:52 +01:00
Łukasz Langa
6864f111fc
Let readers know E203 and W503 are explained later 2019-10-28 13:21:30 +01:00
Łukasz Langa
c336b08bff
Put missing features and fixes in the change log 2019-10-28 13:12:58 +01:00
Yngve Høiseth
a6d866990e Automatic markdown and YAML formatting with Prettier (#874) 2019-10-21 11:42:46 +02:00
Asger Hautop Drewsen
4bcae4cf83 Use better default venv dir when using neovim (#937) 2019-10-20 16:43:02 +02:00
Andrew Thorp
893dd952a5 Update README.md (#906)
Add Kakoune integration instructions
2019-10-20 16:26:17 +02:00
Florent Thiery
84e22b75c6 add instructions to Readme for installing vim plugin using vim native package loading, and how to map a key to run it manually (#944) 2019-10-20 16:07:07 +02:00
Linus Groh
73bd7038fb Add black version header to blackd responses (#1046) 2019-10-13 11:35:31 -07:00
Hugo van Kemenade
faaa2c8d59 Used by: add pandas and Pillow (#1057) 2019-10-10 20:19:43 -07:00
vezeli
c4d2db4323 Change variable in README according to the PEP8 (#1002)
* Change variable in README according to the PEP8
* Change variable in tests according to the PEP8
2019-09-04 09:11:07 +01:00
Zsolt Dollenstein
720dd415f7 add change log entry 2019-07-28 16:22:17 +01:00
Mariatta
eb5f84eb8c Fix Travis CI badge (#939)
It should point to travis-ci.com instead of .org
2019-07-24 18:09:55 -07:00
Asger Hautop Drewsen
235a0b5bcb Change repo name to psf/black in README (#938) 2019-07-24 17:54:05 +01:00
Zsolt Dollenstein
77b6ed1b70 Hello github.com/psf! 2019-07-22 21:41:45 +01:00
Juan Luis Cano Rodríguez
7c556faf5f Ignore broken E203 (#910)
See https://github.com/python/black/issues/565
2019-06-25 07:27:02 -07:00
Adam Johnson
1fbf7251cc Add W503 to default flake8 ignore list (#894)
W503 and W504 are mutually exclusive, to do with splitting binary operators across lines. Black reformats code according to W504, putting the operator on the start of the newline, therefore W503 needs to be ignored in the suggested Flake8 config to use with Black.
2019-06-16 08:39:03 -07:00
Zsolt Dollenstein
5206560946
add change log entry 2019-06-15 07:36:34 +01:00
Ofek Lev
1bbb01b854 Add Datadog to list of users (#876) 2019-06-06 08:34:58 +01:00
Aviskar KC
d410763d8d Add link to the pyproject.toml for setting up pre-commit hook (#885) 2019-06-06 08:33:09 +01:00
Yngve Høiseth
bc7a4b2391 Document cache location configuration (#866) 2019-05-26 12:08:22 +02:00
Zsolt Dollenstein
519c06a8cc
Don't introduce quotes to f-string sub-expressions on string boundaries (#871) 2019-05-26 11:58:00 +02:00
Stephen Rosen
a4399f3054 Add doc clarifying that there is no blackd client (#859)
Resolves #854

The first sentence of this is pretty uncontroversial. (Though I wasn't
sure exactly where in the text to put it.)
I thought it would also be nice to show the `curl` test with a tiny
statement that actually reformats.
2019-05-20 18:57:09 +01:00
Łukasz Langa
188c31db7c
Mention support for async generators 2019-05-09 18:19:33 +02:00
Łukasz Langa
189520bff1
Change log wording and ordering 2019-05-09 18:18:10 +02:00
Łukasz Langa
bc36e95966
acks += bgw 2019-05-09 18:04:09 +02:00
Łukasz Langa
8c8adedc2a
acks += revfried 2019-05-09 17:08:31 +02:00
Łukasz Langa
0aa21af9e1
Mention fix for backslashes before standalone comments 2019-05-09 17:07:06 +02:00
Carol Willing
f5381c7c5f Add PyCon talk link to README (#844) 2019-05-08 14:52:41 -04:00
Hugo
f50ba078b3 Minor README updates (#842)
* Header in sentence case, for consistency

* Black in italics
2019-05-08 09:06:19 -04:00
Łukasz Langa
a23f4cfdbd
Mention Elpy
Fixes #689
2019-05-07 22:16:29 +02:00
Łukasz Langa
3b96abdb80
humility -= 1 2019-05-07 20:29:31 +02:00
Jelle Zijlstra
14cbf737df
don't run more than 61 workers on Windows (#838) 2019-05-07 13:11:20 -04:00
Arjaan Buijk
3b2297f6fd Describe how to add black to Wing IDE (#758) 2019-05-07 10:17:00 -04:00
Jelle Zijlstra
06004cd319 Add black -c "code" (#761) 2019-05-07 09:58:59 -04:00
Jelle Zijlstra
4a7da71069
add to changelog 2019-05-07 09:52:41 -04:00
Hugo
c2c2f72038 Update calver version number (#835)
If released this month, it will be 19.5b0.
2019-05-06 22:02:09 -04:00
Jelle Zijlstra
dd5777af06
add to CHANGELOG 2019-05-06 11:09:04 -04:00
Hugo
4a953b7241 ambv/black -> python/black (#819) 2019-05-02 20:19:52 +01:00
Daniele Esposti
0b7913f904 Terget version option kebab-style (#770) 2019-03-20 08:40:01 -07:00
Jelle Zijlstra
f92cd878ad
add change log entry (#764) 2019-03-15 11:42:24 -07:00
Jelle Zijlstra
129ebd53a6 Add back --py36 as a deprecated option (#750)
This partially reverts commit 21ab37a5d9.
2019-03-14 17:31:27 +01:00