Commit Graph

236 Commits

Author SHA1 Message Date
Alexandr Artemyev
07b68e2425
add preview option support for blackd (#3217)
Fixes #3195

Co-authored-by: Richard Si <63936253+ichard26@users.noreply.github.com>
2022-08-12 20:23:02 -07:00
dependabot[bot]
b776bf92ad
Bump sphinx from 5.1.0 to 5.1.1 in /docs (#3201)
Bumps [sphinx](https://github.com/sphinx-doc/sphinx) from 5.1.0 to 5.1.1.
- [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.1.0...v5.1.1)

---
updated-dependencies:
- dependency-name: sphinx
  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>
2022-08-01 13:51:46 -04:00
dependabot[bot]
e9e756da7a
Bump sphinx from 5.0.2 to 5.1.0 in /docs (#3183)
Bumps [sphinx](https://github.com/sphinx-doc/sphinx) from 5.0.2 to 5.1.0.
- [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.0.2...v5.1.0)

---
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-07-26 20:51:32 -04:00
onescriptkid
b0eed7c6bd
Fix typo in config docs for --extend-exclude (#3170)
The old regex in the example was invalid and caused an error on startup.
2022-07-14 19:51:18 -04:00
Nimrod
8900e3ac8a
Add warning to not run blackd publicly in docs (#3167)
Co-authored-by: Jelle Zijlstra <jelle.zijlstra@gmail.com>
2022-07-14 15:22:29 -04:00
Maciej Olko
05b63c4bcc
Recommend using BlackConnect in IntelliJ IDEs (#3150)
* Recommend using BlackConnect in IntelliJ IDEs

* IntelliJ IDEs integration docs: improve formatting

* Add changelog for recommending BlackConnect

* IntelliJ IDEs integration docs: improve formatting

* Apply suggestions from code review

Co-authored-by: Richard Si <63936253+ichard26@users.noreply.github.com>

* Fix indentation

* Apply italic to Black name

Consequently with other places in the document

* Move CHANGELOG entry to Unreleased section

* IntelliJ IDEs integration docs: bring back a point with formatting a file

* IntelliJ IDEs integration docs: fix extra whitespace and linebreak

Co-authored-by: Richard Si <63936253+ichard26@users.noreply.github.com>
2022-07-11 09:27:51 -07:00
Jelle Zijlstra
7af77d1cf1
Stability policy: permit exceptional changes for unformatted code (#3155) 2022-07-06 13:33:07 -04:00
Richard Si
f6c139c521
Prepare docs for release 22.6.0 (#3139) 2022-06-27 20:33:35 -04:00
Felix Hildén
eb5d175c9c
Update preview style docs to include recent changes (#3136)
Covers GH-2926, GH-2990, GH-2991, and GH-3035.

Co-authored-by: Jelle Zijlstra <jelle.zijlstra@gmail.com>
Co-authored-by: Richard Si <63936253+ichard26@users.noreply.github.com>
2022-06-27 16:24:34 -04:00
dependabot[bot]
d848209d38
Bump furo from 2022.6.4.1 to 2022.6.21 in /docs (#3138)
Bumps [furo](https://github.com/pradyunsg/furo) from 2022.6.4.1 to 2022.6.21.
- [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.06.04.1...2022.06.21)

---
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>
2022-06-27 09:54:49 -04:00
dependabot[bot]
6463fb874f
Bump sphinx from 5.0.1 to 5.0.2 in /docs (#3128)
Bumps [sphinx](https://github.com/sphinx-doc/sphinx) from 5.0.1 to 5.0.2.
- [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.0.1...v5.0.2)

---
updated-dependencies:
- dependency-name: sphinx
  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>
2022-06-20 10:22:24 -04:00
Richard Si
8c8675c62a
Update documentation dependencies (#3118)
Furo, myst-parser, and Sphinx (had to pin docutils due to sphinx breakage)
2022-06-11 11:44:01 -04:00
Sagi Shadur
4bb7bf2bdc
Remove newline after code block open (#3035)
Co-authored-by: Jelle Zijlstra <jelle.zijlstra@gmail.com>
2022-06-11 09:55:01 +03:00
Yusuke Nishioka
9fe788d870
Add more examples to exclude files in addition to the defaults (#3070)
Co-authored-by: Jelle Zijlstra <jelle.zijlstra@gmail.com>
2022-05-26 07:44:26 -07:00
laundmo
fdb01f8622
Document new Microsoft Black Formatter extension for VSCode (#3063)
Co-authored-by: Richard Si <63936253+ichard26@users.noreply.github.com>
2022-05-21 16:18:06 -04:00
Felix Hildén
62c2b167bc
Docs: clarify fmt:on/off requirements (#2985) (#3048) 2022-05-07 17:58:10 -07:00
dependabot[bot]
9d5edd3020
Bump myst-parser from 0.16.1 to 0.17.2 in /docs (#3019)
Bumps [myst-parser](https://github.com/executablebooks/MyST-Parser) from 0.16.1 to 0.17.2.
- [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/v0.16.1...v0.17.2)

---
updated-dependencies:
- dependency-name: myst-parser
  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-05-02 11:12:23 -06:00
JiriKr
8ed3e3d07e
Updated Black Docker Hub link in docs (#3023)
Fixes #3022
2022-04-21 12:55:56 -07:00
Jelle Zijlstra
96bd428524
Quote black[jupyter] and black[d] in installation docs (#3006)
We just got someone on Discord who was confused because the command as
written caused their shell to try to do command expansion.

Co-authored-by: Richard Si <63936253+ichard26@users.noreply.github.com>
2022-04-11 19:25:46 -04:00
dependabot[bot]
911b59fb4f
Bump furo from 2022.3.4 to 2022.4.7 in /docs (#3003)
Bumps [furo](https://github.com/pradyunsg/furo) from 2022.3.4 to 2022.4.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.03.04...2022.04.07)

---
updated-dependencies:
- dependency-name: furo
  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-04-11 19:24:00 -04:00
Richard Si
497a72560d
Explain our use of mypyc in the FAQ (#3002)
I realized we don't have a FAQ entry about this, let's change that so
compiled: yes/no doesn't surprise as many people :)

Co-authored-by: Jelle Zijlstra <jelle.zijlstra@gmail.com>
2022-04-10 19:45:34 -04:00
Jan-Hendrik Müller
421383d560
Update FAQ: Mention formatting of custom jupyter cell magic (#2982)
Co-authored-by: Jelle Zijlstra <jelle.zijlstra@gmail.com>
Co-authored-by: Richard Si <63936253+ichard26@users.noreply.github.com>
2022-04-04 18:24:16 -07:00
Gunung P. Wibisono
3dea6e3635
Convert index.rst and license.rst to markdown (#2852)
Co-authored-by: Richard Si <63936253+ichard26@users.noreply.github.com>
2022-03-30 13:43:46 -07:00
Jelle Zijlstra
ae2c0758c9
Prepare release 22.3.0 (#2968) 2022-03-28 12:08:29 -07:00
dependabot[bot]
ac7402cbf6
Bump sphinx from 4.4.0 to 4.5.0 in /docs (GH-2959)
Bumps [sphinx](https://github.com/sphinx-doc/sphinx) from 4.4.0 to 4.5.0.
- [Release notes](https://github.com/sphinx-doc/sphinx/releases)
- [Changelog](https://github.com/sphinx-doc/sphinx/blob/4.x/CHANGES)
- [Commits](https://github.com/sphinx-doc/sphinx/compare/v4.4.0...v4.5.0)

---
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-03-28 13:21:13 -04:00
Richard Si
f239d227c0
Enforce no formatting changes for PRs via CI (GH-2951)
Now PRs will run two diff-shades jobs, "preview-changes" which formats
all projects with preview=True, and "assert-no-changes" which formats
all projects with preview=False. The latter also fails if any changes
were made.

Pushes to main will only run "preview-changes"

Also the workflow_dispatch feature was dropped since it was
complicating everything for little gain.
2022-03-26 17:22:38 -04:00
Richard Si
062b54931d
Github now supports .git-blame-ignore-revs (GH-2948)
It's in beta.

https://docs.github.com/en/repositories/working-with-files/using-files/viewing-a-file#ignore-commits-in-the-blame-view
2022-03-23 13:31:13 -04:00
Jelle Zijlstra
5379d4f3f4
stub style: remove some possible future changes (#2940)
Fixes #2938.

All of these suggested future changes are out of scope for an autoformatter and should be handled by a linter instead.
2022-03-21 15:20:41 -07:00
Joseph Young
fa7f01592b
Update pylint config docs (#2931) 2022-03-16 10:00:30 -07:00
Richard Si
a57ab326b2
Farewell black-primer, it was nice knowing you (#2924)
Enjoy your retirement at https://github.com/cooperlees/black-primer
2022-03-15 12:57:59 -07:00
dependabot[bot]
eb213151ce
Bump furo from 2022.2.14.1 to 2022.3.4 in /docs (#2906)
Bumps [furo](https://github.com/pradyunsg/furo) from 2022.2.14.1 to 2022.3.4.
- [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.02.14.1...2022.03.04)

---
updated-dependencies:
- dependency-name: furo
  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-03-04 16:48:53 -08:00
Jelle Zijlstra
6cfb51871b
separate CHANGELOG section for preview style (#2890) 2022-02-23 18:32:00 -08:00
dependabot[bot]
7e2b2d4784
Bump furo from 2022.1.2 to 2022.2.14.1 in /docs (GH-2892)
Bumps [furo](https://github.com/pradyunsg/furo) from 2022.1.2 to 2022.2.14.1.
- [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.01.02...2022.02.14.1)

---
updated-dependencies:
- dependency-name: furo
  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-02-23 12:00:06 -05:00
D. Ben Knoble
8089aaad6b
correct Vim integration code (#2853)
- use `Black` directly: the commands an autocommand runs are Ex commands, so no
  execute or colon is necessary.
- use an `augroup` (best practice) to prevent duplicate autocommands from
  hindering performance.
2022-02-20 17:37:07 -08:00
Laurent Lyaudet
07a2e6f678
Fix typo in file_collection_and_discovery.md (GH-2860)
"you your" -> "your"

Co-authored-by: Felix Hildén <felix.hilden@gmail.com>
2022-02-10 20:32:55 -05:00
Xuan (Sean) Hu
862c6f2c0c
Order the disabled error codes for pylint (GH-2870)
Just make them alphabetical.
2022-02-10 20:31:28 -05:00
dependabot[bot]
01001d5cff
Bump sphinx-copybutton from 0.4.0 to 0.5.0 in /docs (#2871)
Bumps [sphinx-copybutton](https://github.com/executablebooks/sphinx-copybutton) from 0.4.0 to 0.5.0.
- [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.4.0...v0.5.0)

---
updated-dependencies:
- dependency-name: sphinx-copybutton
  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-02-07 07:31:58 -08:00
Felix Hildén
31fe97e7ce
Create indentation FAQ entry (#2855)
Co-authored-by: Jelle Zijlstra <jelle.zijlstra@gmail.com>
2022-02-02 08:59:42 +02:00
Jelle Zijlstra
afc0fb05cb
release process: formalize the changelog template (#2837)
I did this manually for the last few releases and I think it's going to be
helpful in the future too. Unfortunately this adds a little more work during
the release (sorry @cooperlees).

This change will also improve the merge conflict situation a bit, because
changes to different sections won't merge conflict.

For the last release, the sections were in a kind of random order. In the
template I put highlights and "Style" first because they're most important
to users, and alphabetized the rest.
2022-01-30 14:04:06 -08:00
Richard Si
d038a24ca2
Prepare docs for release 22.1.0 (GH-2826) 2022-01-29 14:30:25 -05:00
Felix Hildén
df0aeeeee0
Formalise style preference description (#2818)
Closes #1256: I reworded our style docs to be more explicit about the style we're aiming for and how it is changed (or isn't).
2022-01-28 16:49:43 -08:00
Felix Hildén
e1506769a4
Elaborate on Python support policy (#2819) 2022-01-28 10:58:17 -08:00
Jelle Zijlstra
b517dfb396
black-primer: stop running it (#2809)
At the moment, it's just a source of spurious CI failures and busywork
updating the configuration file.

Unlike diff-shades, it is run across many different platforms and
Python versions, but that doesn't seem essential. We already run unit
tests across platforms and versions.

I chose to leave the code around for now in case somebody is using it,
but CI will no longer run it.
2022-01-26 17:18:43 -08:00
Richard Si
6417c99bfd
Hug power operators if its operands are "simple" (#2726)
Since power operators almost always have the highest binding power in expressions, it's often more readable to hug it with its operands. The main exception to this is when its operands are non-trivial in which case the power operator will not hug, the rule for this is the following:

> For power ops, an operand is considered "simple" if it's only a NAME, numeric CONSTANT, or attribute access (chained attribute access is allowed), with or without a preceding unary operator. 

Fixes GH-538.
Closes GH-2095.

diff-shades results: https://gist.github.com/ichard26/ca6c6ad4bd1de5152d95418c8645354b

Co-authored-by: Diego <dpalma@evernote.com>
Co-authored-by: Felix Hildén <felix.hilden@gmail.com>
Co-authored-by: Jelle Zijlstra <jelle.zijlstra@gmail.com>
2022-01-24 19:13:34 -08:00
Felix Hildén
73cb6e7734
Make SRC or code mandatory and mutually exclusive (#2360) (#2804)
Closes #2360: I'd like to make passing SRC or `--code` mandatory and the arguments mutually exclusive. This will change our (partially already broken) promises of CLI behavior, but I'll comment below.
2022-01-24 07:35:56 -08:00
Cooper Lees
d2c938eb02
Remove Beta mentions in README + Docs (#2801)
- State we're now stable and that we'll uphold our formatting changes as per policy
- Link to The Black Style doc.

Co-authored-by: Jelle Zijlstra <jelle.zijlstra@gmail.com>
2022-01-23 12:34:01 -08:00
Perry Vargas
10677baa40
Allow setting custom cache directory on all platforms (#2739)
Fixes #2506

``XDG_CACHE_HOME`` does not work on Windows. To allow for users to set a custom cache directory on all systems I added a new environment variable ``BLACK_CACHE_DIR`` to set the cache directory. The default remains the same so users will only notice a change if that environment variable is set.

The specific use case I have for this is I need to run black on in different processes at the same time. There is a race condition with the cache pickle file that made this rather difficult. A custom cache directory will remove the race condition.

I created ``get_cache_dir`` function in order to test the logic. This is only used to set the ``CACHE_DIR`` constant.
2022-01-21 22:00:33 -08:00
Richard Si
d24bc4364c
Switch to Furo (#2793)
- Add Furo dependency to docs/requirements.txt
- Drop a fair bit of theme configuration
- Fix the toctree declarations in index.rst
- Move stuff around as Furo isn't 100% compatible with Alabaster

Furo was chosen as it provides excellent mobile support, user
controllable light/dark theming, and is overall easier to read
2022-01-21 15:00:13 -08:00
Felix Hildén
6e97c5f47c
Deprecate ESP and move the functionality under --preview (#2789) 2022-01-20 15:42:07 -08:00
Richard Si
9bd4134f31
Fix and speedup diff-shades integration (#2773) 2022-01-19 19:05:58 -08:00