Commit Graph

302 Commits

Author SHA1 Message Date
rdrll
d1248ca9be
Doc: updating url link (#3739) 2023-06-20 07:06:03 -07:00
dependabot[bot]
e7783e9ab2
Bump myst-parser from 1.0.0 to 2.0.0 in /docs (#3738)
Bumps [myst-parser](https://github.com/executablebooks/MyST-Parser) from 1.0.0 to 2.0.0.
- [Release notes](https://github.com/executablebooks/MyST-Parser/releases)
- [Changelog](https://github.com/executablebooks/MyST-Parser/blob/master/CHANGELOG.md)
- [Commits](https://github.com/executablebooks/MyST-Parser/compare/v1.0.0...v2.0.0)

---
updated-dependencies:
- dependency-name: myst-parser
  dependency-type: direct:production
  update-type: version-update:semver-major
...

Signed-off-by: dependabot[bot] <support@github.com>
Co-authored-by: dependabot[bot] <49699333+dependabot[bot]@users.noreply.github.com>
2023-06-19 06:58:20 -07:00
Alwyn Kik
35722dff62
Max line length with bugbear (#3731)
* Make phrasing for flake8 users more concise

max-line-length should be 80 with flake8-bugbear
Fixes #3716

* Re-add rationale and an explanation for

disabling E203

* Run pre-commit
2023-06-12 12:20:31 -07:00
Ville Skyttä
898915d556
Use aware datetimes to represent UTC (#3728)
Avoids a Python 3.12 deprecation warning.

Subtle difference: previously, timestamps in diff filenames had the
`+0000` separated from the timestamp by space. With this, the space is
there no more, and there is a colon, as in `+00:00`.
2023-06-10 09:54:21 -07:00
Jelle Zijlstra
c42178690e
Fix docs formatting (#3704) 2023-05-24 21:06:08 -07:00
Jelle Zijlstra
3decbd6db9
Document each configuration option in more detail (#2839) 2023-05-24 19:55:12 -07:00
Stefaan Lippens
f95b43d6fa
docs: update note on GitHub .git-blame-ignore-revs support (#3655) 2023-05-24 19:53:27 -07:00
Deepyaman Datta
c99417ffe8
Change example from %%writeline to %%writefile (#3673) 2023-05-24 19:52:59 -07:00
dependabot[bot]
cd02c2809b
Bump furo from 2023.3.27 to 2023.5.20 in /docs (#3698)
Signed-off-by: dependabot[bot] <support@github.com>
Co-authored-by: dependabot[bot] <49699333+dependabot[bot]@users.noreply.github.com>
2023-05-22 11:47:58 -04:00
James Braza
4b76a54815
Document black-jupyter hook (#3650)
Co-authored-by: Jelle Zijlstra <jelle.zijlstra@gmail.com>
2023-04-19 03:24:03 -07:00
dependabot[bot]
3da7339955
Bump sphinx-copybutton from 0.5.1 to 0.5.2 in /docs (#3651)
Bumps [sphinx-copybutton](https://github.com/executablebooks/sphinx-copybutton) from 0.5.1 to 0.5.2.
- [Release notes](https://github.com/executablebooks/sphinx-copybutton/releases)
- [Changelog](https://github.com/executablebooks/sphinx-copybutton/blob/master/CHANGELOG.md)
- [Commits](https://github.com/executablebooks/sphinx-copybutton/compare/v0.5.1...v0.5.2)

---
updated-dependencies:
- dependency-name: sphinx-copybutton
  dependency-type: direct:production
  update-type: version-update:semver-patch
...

Signed-off-by: dependabot[bot] <support@github.com>
Co-authored-by: dependabot[bot] <49699333+dependabot[bot]@users.noreply.github.com>
2023-04-17 07:17:11 -07:00
Harutaka Kawamura
a552f7096a
Fix an example for 'Improved parentheses management' in the (future of the) Black code style (#3635) 2023-04-03 06:56:59 -07:00
dependabot[bot]
96ee2fef3d
Bump furo from 2023.3.23 to 2023.3.27 in /docs (#3636)
Bumps [furo](https://github.com/pradyunsg/furo) from 2023.3.23 to 2023.3.27.
- [Release notes](https://github.com/pradyunsg/furo/releases)
- [Changelog](https://github.com/pradyunsg/furo/blob/main/docs/changelog.md)
- [Commits](https://github.com/pradyunsg/furo/compare/2023.03.23...2023.03.27)

---
updated-dependencies:
- dependency-name: furo
  dependency-type: direct:production
  update-type: version-update:semver-patch
...

Signed-off-by: dependabot[bot] <support@github.com>
Co-authored-by: dependabot[bot] <49699333+dependabot[bot]@users.noreply.github.com>
2023-04-03 06:55:17 -07:00
Jelle Zijlstra
9b2b048692
Prepare release 23.3.0 (#3625) 2023-03-28 17:46:04 -07:00
dependabot[bot]
f3b1a3b9d2
Bump furo from 2022.12.7 to 2023.3.23 in /docs (#3624)
Signed-off-by: dependabot[bot] <support@github.com>
Co-authored-by: dependabot[bot] <49699333+dependabot[bot]@users.noreply.github.com>
2023-03-27 07:15:43 -04:00
dependabot[bot]
5c064a986c
Bump sphinx from 5.3.0 to 6.1.3 in /docs (#3499)
Signed-off-by: dependabot[bot] <support@github.com>
Co-authored-by: dependabot[bot] <49699333+dependabot[bot]@users.noreply.github.com>
2023-03-19 19:00:14 -04:00
dependabot[bot]
3a9d6f0a5f
Bump myst-parser from 0.18.1 to 1.0.0 in /docs (#3601)
Signed-off-by: dependabot[bot] <support@github.com>
Co-authored-by: dependabot[bot] <49699333+dependabot[bot]@users.noreply.github.com>
Co-authored-by: Richard Si <sichard26@gmail.com>
2023-03-19 18:52:40 -04:00
Mitch Negus
a3e8247a41
Update documentation regarding isort compatibility (#3567) 2023-03-18 13:30:02 -07:00
Casey Korver
6ffc5f7b01
Correct spelling mistakes (#3599) 2023-03-11 07:43:31 -08:00
Aneesh Agrawal
4a063a9f8d
Improve multiline string handling (#1879)
Co-authored-by: Olivia Hong <ohong@lyft.com>
Co-authored-by: Olivia Hong <24500729+olivia-hong@users.noreply.github.com>
2023-03-07 11:52:19 -08:00
brucearctor
d9b8a6407e
Update Action example to use checkout@v3 (#3563)
Latest version of `actions/checkout` is v3 (or rather v3.3) so let's
use that in the example now.
2023-02-13 20:24:28 -05:00
Richard Si
e506c46f7b
Rename design label to style because it's clearer (#3547) 2023-02-04 22:51:46 -05:00
Yilei "Dolee" Yang
ea5293b036
Document the future style changes introduced in #3489 and #3440 (#3541) 2023-02-04 22:30:47 -05:00
Jelle Zijlstra
b0d1fba7ac
Prepare release 23.1.0 (#3536)
Co-authored-by: Richard Si <sichard26@gmail.com>
2023-01-31 18:47:11 -08:00
Jelle Zijlstra
c4bd2e31ce
Draft for Black 2023 stable style (#3418) 2023-01-31 15:39:56 -08:00
Evan Chen
6407ebb870
Remove Python version in the_basics.md (#3528) 2023-01-28 16:12:11 -08:00
Yilei "Dolee" Yang
d950f15987
Update document now that paren wrapping CMs on Python 3.9+ is implemented (#3520) 2023-01-23 21:38:30 -08:00
Michael Eliachevitch
1557f7d3a3
Use dashes for pycodestyle max line length config (#3513)
The option is `max-line-length` with dashes, not underscores. The config option name is given in the output of `pycodestyle -h`, which can also be checked on https://pep8.readthedocs.io/en/stable/intro.html#example-usage-and-output:
```
Configuration:
    The project options are read from the [pycodestyle] section of the
    tox.ini file or the setup.cfg file located in any parent folder of the
    path(s) being processed.  Allowed options are: exclude, filename,
    select, ignore, max-line-length, max-doc-length, hang-closing, count,
    format, quiet, show-pep8, show-source, statistics, verbose
```
2023-01-21 21:20:54 -08:00
Ruslan
d4ff985853
Add IntelliJ docs on external tools and file watcher (#3365)
Revert deleted documentation on setting up Black using IntelliJ
external tool or file watcher utilities. These are still worth keeping
because some peole might not want to use a third-party plugin or
install Blackd's extra dependencies.

Co-authored-by: Richard Si <sichard26@gmail.com>
2023-01-14 13:32:00 -05:00
Yilei "Dolee" Yang
f758010340
Documentation: clarify the state of multiple context managers (#3488)
Clarify that the backslash & paren-wrapping formatting for multiple
context managers aren't yet implemented.
2023-01-14 12:51:59 -05:00
Bruno Oliveira
4bee9cca55
Remove misleading phrase in Usage and Configuration (#3492)
The CLI options were already shown in the "Command line options" in the same page.
2023-01-11 11:19:27 -08:00
Semen Zhydenko
9b91638190
Fix some typos (#3474) 2022-12-25 18:39:51 -08:00
Matthew Armand
3246df89d6
Add latest_prerelease Docker Hub tag for following the latest alpha release (#3465)
Co-authored-by: Jelle Zijlstra <jelle.zijlstra@gmail.com>
2022-12-20 19:18:15 -08:00
Matthew Armand
59f03d1b9d
Vim plugin docs improvements (#3468)
* Organize vim plugin section with headers to separate out Installation, Usage, and Troubleshooting for readability and easy linking

* Add missing plugin configuration options, with current defaults

* Add installation note for Arch Linux, now that the plugin is shipped with the python-black package (ref: https://bugs.archlinux.org/task/73024)

* Fix vim-plug specification to follow stable releases. Moving the same tag is an antipattern that doesn't re-resolve with vim-plug, see this discussion for more detail (https://github.com/junegunn/vim-plug/pull/720\#issuecomment-1105829356). Per vim-plug's maintainer's recommendation, use the 'tag' key instead with a shell wildcard. Wildcard should be '*.*.*' as that follows Black's versioning detailed here (https://black.readthedocs.io/en/latest/contributing/release_process.html\#cutting-a-release) and doesn't include current alpha releases.
2022-12-20 15:00:06 -08:00
dependabot[bot]
abd2b2556a
Bump furo from 2022.9.29 to 2022.12.7 in /docs (#3433)
Bumps [furo](https://github.com/pradyunsg/furo) from 2022.9.29 to 2022.12.7.
- [Release notes](https://github.com/pradyunsg/furo/releases)
- [Changelog](https://github.com/pradyunsg/furo/blob/main/docs/changelog.md)
- [Commits](https://github.com/pradyunsg/furo/compare/2022.09.29...2022.12.07)

---
updated-dependencies:
- dependency-name: furo
  dependency-type: direct:production
  update-type: version-update:semver-minor
...

Signed-off-by: dependabot[bot] <support@github.com>

Signed-off-by: dependabot[bot] <support@github.com>
Co-authored-by: dependabot[bot] <49699333+dependabot[bot]@users.noreply.github.com>
2022-12-12 06:28:12 -08:00
Marco Edward Gorelli
16b98abca9
make black[jupyter] installation cross-shell (#3394) 2022-12-10 11:49:33 -08:00
Jelle Zijlstra
2ddea293a8
Prepare release 22.12.0 (#3413) 2022-12-09 07:49:43 -08:00
dependabot[bot]
d4a85643a4
Bump sphinx-copybutton from 0.5.0 to 0.5.1 in /docs (#3390)
Bumps [sphinx-copybutton](https://github.com/executablebooks/sphinx-copybutton) from 0.5.0 to 0.5.1.
- [Release notes](https://github.com/executablebooks/sphinx-copybutton/releases)
- [Changelog](https://github.com/executablebooks/sphinx-copybutton/blob/master/CHANGELOG.md)
- [Commits](https://github.com/executablebooks/sphinx-copybutton/compare/v0.5.0...v0.5.1)

---
updated-dependencies:
- dependency-name: sphinx-copybutton
  dependency-type: direct:production
  update-type: version-update:semver-patch
...

Signed-off-by: dependabot[bot] <support@github.com>

Signed-off-by: dependabot[bot] <support@github.com>
Co-authored-by: dependabot[bot] <49699333+dependabot[bot]@users.noreply.github.com>
2022-11-21 08:24:46 -08:00
sckarlin
27932494bc
Wordsmith current_style.md (#3383)
"realtime" doesn't make sense in this context.
2022-11-14 07:31:43 -08:00
Maximilian Cosmo Sitter
c23a5c15aa
Clarify that Black runs with --safe by default (#3378) 2022-11-10 10:14:48 -05:00
Gerhard van Andel
2704dc796b
Update docs to include pycodestyle (#3369)
* Add pycodestyle to using_black_with_other_tools.md
2022-11-01 11:42:48 -07:00
Corey Hickey
4bb6e4f64a
Vim plugin: allow using system black rather than virtualenv (#3309)
Provide a configuration parameter to the Vim plugin which will allow the
plugin to skip setting up a virtualenv. This is useful when there is a
system installation of black (e.g. from a Linux distribution) which the
user prefers to use.

Using a virtualenv remains the default.

- Fixes #3308
2022-10-27 18:55:33 -05:00
Yilei "Dolee" Yang
4abc0399b5
Enforce empty lines before classes/functions with sticky leading comments. (#3302)
Co-authored-by: Jelle Zijlstra <jelle.zijlstra@gmail.com>
2022-10-25 18:03:24 -07:00
dependabot[bot]
f22273a72b
Bump sphinx from 5.2.3 to 5.3.0 in /docs (#3333)
updated-dependencies:
- dependency-name: sphinx
  dependency-type: direct:production
  update-type: version-update:semver-minor

Signed-off-by: dependabot[bot] <support@github.com>
Co-authored-by: dependabot[bot] <49699333+dependabot[bot]@users.noreply.github.com>
2022-10-17 21:12:41 -04:00
jlplenio
575220f460
Clarify check argument is needed for github action workflow (#3325)
Co-authored-by: Richard Si <63936253+ichard26@users.noreply.github.com>
2022-10-15 19:44:02 +01:00
Jelle Zijlstra
27d20144a7
Prepare release 22.10.0 (#3311) 2022-10-06 15:33:51 -07:00
Antonio Ossa-Guerra
4da0851809
Add option to skip the first line of source code (#3299)
* Add option to skip the first line in source file

This commit adds a CLi option to skip the first line in the source
files, just like the Cpython command line allows [1]. By enabling the
flag, using `-x` or `--skip-source-first-line`, the first line is
removed temporarilly while the remaining contents are formatted. The
first line is added back before returning the formatted output.

[1]: https://docs.python.org/dev/using/cmdline.html#cmdoption-x

Signed-off-by: Antonio Ossa Guerra <aaossa@uc.cl>

* Add tests for `--skip-source-first-line` option

When the flag is disabled (default), black formats the entire source
file, as in every line. In the other hand, if the flag is enabled, by
using `-x` or `--skip-source-first-line`, the first line is retained
while the rest of the source is formatted and then is added back.

These tests use an empty Python file that contains invalid syntax in
its first line (`invalid_header.py`, at `miscellaneous/`). First,
Black is invoked without enabling the flag which should result in an
exit code different than 0. When the flag is enabled, Black is
expected to return a successful exit code and the header is expected
to be retained (even if its not valid Python syntax).

Signed-off-by: Antonio Ossa Guerra <aaossa@uc.cl>

* Support skip source first line option for blackd

The recently added option can be added as an acceptable header for
blackd. The arguments are passed in such a way that using the new
header will activate the skip source first line behaviour as expected

Signed-off-by: Antonio Ossa Guerra <aaossa@uc.cl>

* Add skip source first line option to blackd docs

The new option can be passed to blackd as a header. This commit
updates the blackd docs to include the new header.

Signed-off-by: Antonio Ossa Guerra <aaossa@uc.cl>

* Update CHANGES.md

Include the new Black option to skip the first line of source code in
the configuration section

Signed-off-by: Antonio Ossa Guerra <aaossa@uc.cl>

* Update skip first line test including valid syntax

Including valid Python syntax help us make sure that the file is still
actually valid after skipping the first line of the source file (which
contains invalid Python syntax)

Signed-off-by: Antonio Ossa Guerra <aaossa@uc.cl>

* Skip first source line at `format_file_in_place`

Instead of skipping the first source line at `format_file_contents`,
do it before. This allow us to find the correct newline and encoding
on the actual source code (everything that's after the header).

This change is also applied at Blackd: take the header before passing
the source to `format_file_contents` and put the header back once we
get the formatted result.

Signed-off-by: Antonio Ossa Guerra <aaossa@uc.cl>

* Test output newlines when skipping first line

When skipping the first line of source code, the reference newline must
be taken from the second line of the file instead of the first one, in
case that the file mixes more than one kind of newline character

Signed-off-by: Antonio Ossa Guerra <aaossa@uc.cl>

* Test that Blackd also skips first line correctly

Simliarly to the Black tests, we first compare that Blackd fails when
the first line is invalid Python syntax and then check that the result
is the expected when tha flag is activated

Signed-off-by: Antonio Ossa Guerra <aaossa@uc.cl>

* Use the content encoding to decode the header

When decoding the header to put it back at the top of the contents of
the file, use the same encoding used in the content. This should be a
better "guess" that using the default value

Signed-off-by: Antonio Ossa Guerra <aaossa@uc.cl>
2022-10-06 15:17:32 -07:00
KotlinIsland
0359b85b58
Preserve crlf line endings in blackd (#3257)
Co-authored-by: KotlinIsland <kotlinisland@users.noreply.github.com>
2022-10-04 13:10:11 -07:00
dependabot[bot]
27d7ea43eb
Bump docutils from 0.18.1 to 0.19 in /docs (#3161)
Bumps [docutils](https://docutils.sourceforge.io/) from 0.18.1 to 0.19.

---
updated-dependencies:
- dependency-name: docutils
  dependency-type: direct:production
  update-type: version-update:semver-minor
...

Signed-off-by: dependabot[bot] <support@github.com>
2022-10-03 09:36:44 -07:00
dependabot[bot]
1a20c4d487
Bump sphinx from 5.2.1 to 5.2.3 in /docs (#3305)
Bumps [sphinx](https://github.com/sphinx-doc/sphinx) from 5.2.1 to 5.2.3.
- [Release notes](https://github.com/sphinx-doc/sphinx/releases)
- [Changelog](https://github.com/sphinx-doc/sphinx/blob/5.x/CHANGES)
- [Commits](https://github.com/sphinx-doc/sphinx/compare/v5.2.1...v5.2.3)

---
updated-dependencies:
- dependency-name: sphinx
  dependency-type: direct:production
  update-type: version-update:semver-patch
...

Signed-off-by: dependabot[bot] <support@github.com>

Signed-off-by: dependabot[bot] <support@github.com>
Co-authored-by: dependabot[bot] <49699333+dependabot[bot]@users.noreply.github.com>
2022-10-03 02:15:59 -05:00