]> git.madduck.net Git - etc/vim.git/log

madduck's git repository

Every one of the projects in this repository is available at the canonical URL git://git.madduck.net/madduck/pub/<projectpath> — see each project's metadata for the exact URL.

All patches and comments are welcome. Please squash your changes to logical commits before using git-format-patch and git-send-email to patches@git.madduck.net. If you'd read over the Git project's submission guidelines and adhered to them, I'd be especially grateful.

SSH access, as well as push access can be individually arranged.

If you use my repositories frequently, consider adding the following snippet to ~/.gitconfig and using the third clone URL listed for each project:

[url "git://git.madduck.net/madduck/"]
  insteadOf = madduck:

etc/vim.git
2 years agoBump docker/setup-buildx-action from 1 to 2 (#3058)
dependabot[bot] [Tue, 10 May 2022 02:22:01 +0000 (22:22 -0400)]
Bump docker/setup-buildx-action from 1 to 2 (#3058)

Bumps [docker/setup-buildx-action](https://github.com/docker/setup-buildx-action) from 1 to 2.
- [Release notes](https://github.com/docker/setup-buildx-action/releases)
- [Commits](https://github.com/docker/setup-buildx-action/compare/v1...v2)

---
updated-dependencies:
- dependency-name: docker/setup-buildx-action
  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>
2 years agoBump docker/login-action from 1 to 2 (#3059)
dependabot[bot] [Tue, 10 May 2022 02:13:12 +0000 (22:13 -0400)]
Bump docker/login-action from 1 to 2 (#3059)

Bumps [docker/login-action](https://github.com/docker/login-action) from 1 to 2.
- [Release notes](https://github.com/docker/login-action/releases)
- [Commits](https://github.com/docker/login-action/compare/v1...v2)

---
updated-dependencies:
- dependency-name: docker/login-action
  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>
2 years agoBump docker/build-push-action from 2 to 3 (#3057)
dependabot[bot] [Tue, 10 May 2022 02:11:29 +0000 (22:11 -0400)]
Bump docker/build-push-action from 2 to 3 (#3057)

Bumps [docker/build-push-action](https://github.com/docker/build-push-action) from 2 to 3.
- [Release notes](https://github.com/docker/build-push-action/releases)
- [Commits](https://github.com/docker/build-push-action/compare/v2...v3)

---
updated-dependencies:
- dependency-name: docker/build-push-action
  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>
2 years agoBump docker/setup-qemu-action from 1 to 2 (#3056)
dependabot[bot] [Tue, 10 May 2022 02:08:56 +0000 (22:08 -0400)]
Bump docker/setup-qemu-action from 1 to 2 (#3056)

Bumps [docker/setup-qemu-action](https://github.com/docker/setup-qemu-action) from 1 to 2.
- [Release notes](https://github.com/docker/setup-qemu-action/releases)
- [Commits](https://github.com/docker/setup-qemu-action/compare/v1...v2)

---
updated-dependencies:
- dependency-name: docker/setup-qemu-action
  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>
2 years agoRead simple data cases automatically (#3034)
Sagi Shadur [Sun, 8 May 2022 19:27:40 +0000 (22:27 +0300)]
Read simple data cases automatically (#3034)

Co-authored-by: Felix Hildén <felix.hilden@gmail.com>
2 years agoPut closing quote on a separate line if docstring is too long (#3044)
Iain Dorrington [Sun, 8 May 2022 04:34:28 +0000 (05:34 +0100)]
Put closing quote on a separate line if docstring is too long (#3044)

Fixes #1632

Co-authored-by: Felix Hildén <felix.hilden@gmail.com>
2 years agoDocs: clarify fmt:on/off requirements (#2985) (#3048)
Felix Hildén [Sun, 8 May 2022 00:58:10 +0000 (03:58 +0300)]
Docs: clarify fmt:on/off requirements (#2985) (#3048)

2 years agoMove imports of `ThreadPoolExecutor` into `reformat_many()`, allowing Black-in-the...
Zac Hatfield-Dodds [Fri, 6 May 2022 14:06:27 +0000 (07:06 -0700)]
Move imports of `ThreadPoolExecutor` into `reformat_many()`, allowing Black-in-the-browser (#3046)

This is a slight perf win for use-cases that don't invoke `reformat_many()`, but more importantly to me today it means I can use Black in pyscript.

2 years agochore: Set permissions for GitHub actions (#3043)
Naveen [Tue, 3 May 2022 13:08:33 +0000 (08:08 -0500)]
chore: Set permissions for GitHub actions (#3043)

Restrict the GitHub token permissions only to the required ones; this way, even if the attackers will succeed in compromising your workflow, they won’t be able to do much.

- Included permissions for the action. https://github.com/ossf/scorecard/blob/main/docs/checks.md#token-permissions

https://docs.github.com/en/actions/using-workflows/workflow-syntax-for-github-actions#permissions

https://docs.github.com/en/actions/using-jobs/assigning-permissions-to-jobs

[Keeping your GitHub Actions and workflows secure Part 1: Preventing pwn requests](https://securitylab.github.com/research/github-actions-preventing-pwn-requests/)

Signed-off-by: naveen <172697+naveensrinivasan@users.noreply.github.com>
2 years agoBump myst-parser from 0.16.1 to 0.17.2 in /docs (#3019)
dependabot[bot] [Mon, 2 May 2022 17:12:23 +0000 (11:12 -0600)]
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>
2 years agoStop pinning lark-parser (#3041)
Cooper Lees [Thu, 28 Apr 2022 16:27:16 +0000 (10:27 -0600)]
Stop pinning lark-parser (#3041)

- Latest version works more

Test: `tox -e fuzz`

2 years agoFix strtobool function (#3025)
Vadim Nikolaev [Thu, 28 Apr 2022 15:17:23 +0000 (20:17 +0500)]
Fix strtobool function (#3025)

* Fix strtobool function for vim plugin
* Update CHANGES.md

Co-authored-by: Cooper Lees <me@cooperlees.com>
2 years agoUpdated Black Docker Hub link in docs (#3023)
JiriKr [Thu, 21 Apr 2022 19:55:56 +0000 (21:55 +0200)]
Updated Black Docker Hub link in docs (#3023)

Fixes #3022

2 years agoSupport 3.11 / PEP 654 syntax (#3016)
Batuhan Taskaya [Fri, 15 Apr 2022 16:25:07 +0000 (19:25 +0300)]
Support 3.11 / PEP 654 syntax (#3016)

2 years agoMake ipynb tests compatible with ipython 8.3.0+ (#3008)
Marco Edward Gorelli [Wed, 13 Apr 2022 23:13:33 +0000 (00:13 +0100)]
Make ipynb tests compatible with ipython 8.3.0+ (#3008)

2 years agoQuote black[jupyter] and black[d] in installation docs (#3006)
Jelle Zijlstra [Mon, 11 Apr 2022 23:25:46 +0000 (16:25 -0700)]
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>
2 years agoBump furo from 2022.3.4 to 2022.4.7 in /docs (#3003)
dependabot[bot] [Mon, 11 Apr 2022 23:24:00 +0000 (19:24 -0400)]
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>
2 years agoQuote "black[jupyter]" in README.md (#3007)
Sam Ezeh [Mon, 11 Apr 2022 22:10:46 +0000 (23:10 +0100)]
Quote "black[jupyter]" in README.md (#3007)

2 years agoBump actions/upload-artifact from 2 to 3 (#3004)
dependabot[bot] [Mon, 11 Apr 2022 21:26:28 +0000 (17:26 -0400)]
Bump actions/upload-artifact from 2 to 3 (#3004)

Bumps [actions/upload-artifact](https://github.com/actions/upload-artifact) from 2 to 3.
- [Release notes](https://github.com/actions/upload-artifact/releases)
- [Commits](https://github.com/actions/upload-artifact/compare/v2...v3)

---
updated-dependencies:
- dependency-name: actions/upload-artifact
  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>
2 years agoExplain our use of mypyc in the FAQ (#3002)
Richard Si [Sun, 10 Apr 2022 23:45:34 +0000 (19:45 -0400)]
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>
2 years agoCorrectly handle fmt: skip comments without internal spaces (#2970)
Ryan Siu [Sat, 9 Apr 2022 20:52:45 +0000 (16:52 -0400)]
Correctly handle fmt: skip comments without internal spaces (#2970)

Co-authored-by: Jelle Zijlstra <jelle.zijlstra@gmail.com>
2 years agoRemove redundant parentheses around awaited coroutines/tasks (#2991)
Joe Young [Sat, 9 Apr 2022 20:49:40 +0000 (21:49 +0100)]
Remove redundant parentheses around awaited coroutines/tasks (#2991)

This is a tricky one as await is technically an expression and therefore
in certain situations requires brackets for operator precedence.
However, the vast majority of await usage is just await some_coroutine(...)
and similar in format to return statements. Therefore this PR removes
redundant parens around these await expressions.

Co-authored-by: Jelle Zijlstra <jelle.zijlstra@gmail.com>
Co-authored-by: Richard Si <63936253+ichard26@users.noreply.github.com>
2 years agoBetter manage return annotation brackets (#2990)
Joe Young [Sat, 9 Apr 2022 14:36:05 +0000 (15:36 +0100)]
Better manage return annotation brackets (#2990)

Allows us to better control placement of return annotations by:

a) removing redundant parens
b) moves very long type annotations onto their own line

Co-authored-by: Jelle Zijlstra <jelle.zijlstra@gmail.com>
2 years agoOutput python version and implementation as part of `--version` flag (#2997)
Joe Young [Wed, 6 Apr 2022 18:04:12 +0000 (19:04 +0100)]
Output python version and implementation as part of `--version` flag (#2997)

Example:

black, 22.1.1.dev56+g421383d.d20220405 (compiled: no)
Python (CPython) 3.9.12

Co-authored-by: Batuhan Taskaya <isidentical@gmail.com>
2 years agoTop PyPI Packages: Use 30-days data, 365 is no longer available (#2995)
Hugo van Kemenade [Wed, 6 Apr 2022 12:48:50 +0000 (15:48 +0300)]
Top PyPI Packages: Use 30-days data, 365 is no longer available (#2995)

2 years agoUpdate FAQ: Mention formatting of custom jupyter cell magic (#2982)
Jan-Hendrik Müller [Tue, 5 Apr 2022 01:24:16 +0000 (03:24 +0200)]
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>
2 years agoUpdate test_black.shhh_click test for click 8+ (#2993)
Richard Si [Tue, 5 Apr 2022 01:23:30 +0000 (21:23 -0400)]
Update test_black.shhh_click test for click 8+ (#2993)

The 8.0.x series renamed its "die on LANG=C" function and the 8.1.x
series straight up deleted it.

Unfortunately this makes this test type check cleanly hard, so we'll
just lint with click 8.1+ (the pre-commit hook configuration was changed
mostly to just evict any now unsupported mypy environments)

2 years agoRemove unnecessary parentheses from `with` statements (#2926)
Joe Young [Sun, 3 Apr 2022 03:27:33 +0000 (04:27 +0100)]
Remove unnecessary parentheses from `with` statements (#2926)

Co-authored-by: Jelle Zijlstra <jelle.zijlstra@gmail.com>
Co-authored-by: Richard Si <63936253+ichard26@users.noreply.github.com>
2 years agoFix broken link in README.md (#2989)
Joe Young [Sat, 2 Apr 2022 23:18:13 +0000 (00:18 +0100)]
Fix broken link in README.md (#2989)

Broken when we converted some more RST docs to MyST

2 years agotry-except tomllib import (#2987)
Jelle Zijlstra [Sat, 2 Apr 2022 15:29:32 +0000 (08:29 -0700)]
try-except tomllib import (#2987)

See #2965

I left the version check in place because mypy doesn't generally like try-excepted imports.

2 years agoBump peter-evans/create-or-update-comment from 1.4.5 to 2 (#2961)
dependabot[bot] [Sat, 2 Apr 2022 15:23:08 +0000 (11:23 -0400)]
Bump peter-evans/create-or-update-comment from 1.4.5 to 2 (#2961)

Bumps [peter-evans/create-or-update-comment](https://github.com/peter-evans/create-or-update-comment) from 1.4.5 to 2.
- [Release notes](https://github.com/peter-evans/create-or-update-comment/releases)
- [Commits](https://github.com/peter-evans/create-or-update-comment/compare/a35cf36e5301d70b76f316e867e7788a55a31dae...c9fcb64660bc90ec1cc535646af190c992007c32)

---
updated-dependencies:
- dependency-name: peter-evans/create-or-update-comment
  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>
2 years agoBump peter-evans/find-comment from 1.3.0 to 2 (#2960)
dependabot[bot] [Sat, 2 Apr 2022 15:22:52 +0000 (11:22 -0400)]
Bump peter-evans/find-comment from 1.3.0 to 2 (#2960)

Bumps [peter-evans/find-comment](https://github.com/peter-evans/find-comment) from 1.3.0 to 2.
- [Release notes](https://github.com/peter-evans/find-comment/releases)
- [Commits](https://github.com/peter-evans/find-comment/compare/d2dae40ed151c634e4189471272b57e76ec19ba8...1769778a0c5bd330272d749d12c036d65e70d39d)

---
updated-dependencies:
- dependency-name: peter-evans/find-comment
  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>
2 years agoRemove click pin in diff-shades workflow (#2979)
Jelle Zijlstra [Wed, 30 Mar 2022 21:33:16 +0000 (14:33 -0700)]
Remove click pin in diff-shades workflow (#2979)

Click 8.1.1 was released with a fix for pallets/click#2227.

2 years agoAdd # type: ignore for click._unicodefun import (#2981)
Jelle Zijlstra [Wed, 30 Mar 2022 21:01:03 +0000 (14:01 -0700)]
Add # type: ignore for click._unicodefun import (#2981)

2 years agoConvert `index.rst` and `license.rst` to markdown (#2852)
Gunung P. Wibisono [Wed, 30 Mar 2022 20:43:46 +0000 (03:43 +0700)]
Convert `index.rst` and `license.rst` to markdown (#2852)

Co-authored-by: Richard Si <63936253+ichard26@users.noreply.github.com>
2 years agoKeep tests working w/ upcoming aiohttp 4.0.0 (#2974)
Richard Si [Wed, 30 Mar 2022 20:40:50 +0000 (16:40 -0400)]
Keep tests working w/ upcoming aiohttp 4.0.0 (#2974)

aiohttp.test_utils.unittest_run_loop was deprecated since aiohttp 3.8
and aiohttp 4 (which isn't a thing quite yet) removes it. To maintain
compatibility with the full range of versions we declare to support,
test_blackd.py will now define a no-op replacement if it can't be
imported.

Also, mypy is painfully slow to use without a cache, let's reenable it.

2 years agoBump actions/cache from 2.1.7 to 3 (GH-2962)
dependabot[bot] [Tue, 29 Mar 2022 01:42:53 +0000 (21:42 -0400)]
Bump actions/cache from 2.1.7 to 3 (GH-2962)

Bumps [actions/cache](https://github.com/actions/cache) from 2.1.7 to 3.
- [Release notes](https://github.com/actions/cache/releases)
- [Commits](https://github.com/actions/cache/compare/v2.1.7...v3)

---
updated-dependencies:
- dependency-name: actions/cache
  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>
2 years agoPrepare release 22.3.0 (#2968)
Jelle Zijlstra [Mon, 28 Mar 2022 19:08:29 +0000 (12:08 -0700)]
Prepare release 22.3.0 (#2968)

2 years agoFix _unicodefun patch code for Click 8.1.0 (#2966)
Jelle Zijlstra [Mon, 28 Mar 2022 19:01:13 +0000 (12:01 -0700)]
Fix _unicodefun patch code for Click 8.1.0 (#2966)

Fixes #2964

2 years agoBump sphinx from 4.4.0 to 4.5.0 in /docs (GH-2959)
dependabot[bot] [Mon, 28 Mar 2022 17:21:13 +0000 (13:21 -0400)]
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>
2 years agoEnforce no formatting changes for PRs via CI (GH-2951)
Richard Si [Sat, 26 Mar 2022 21:22:38 +0000 (17:22 -0400)]
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.

2 years agoRemove unnecessary parentheses from `except` clauses (#2939)
Joe Young [Sat, 26 Mar 2022 16:56:50 +0000 (16:56 +0000)]
Remove unnecessary parentheses from `except` clauses (#2939)

Co-authored-by: Jelle Zijlstra <jelle.zijlstra@gmail.com>
2 years agoResolve new flake8-bugbear errors (B020) (GH-2950)
Joe Young [Thu, 24 Mar 2022 15:14:21 +0000 (15:14 +0000)]
Resolve new flake8-bugbear errors (B020) (GH-2950)

Fixes a couple places where we were using the same variable name as we
are iterating over.

Co-authored-by: Jelle Zijlstra <jelle.zijlstra@gmail.com>
2 years agoRemove unnecessary parentheses from tuple unpacking in `for` loops (#2945)
Joe Young [Thu, 24 Mar 2022 14:59:54 +0000 (14:59 +0000)]
Remove unnecessary parentheses from tuple unpacking in `for` loops (#2945)

2 years agoAvoid magic-trailing-comma in single-element subscripts (#2942)
Joe Young [Thu, 24 Mar 2022 02:16:09 +0000 (02:16 +0000)]
Avoid magic-trailing-comma in single-element subscripts (#2942)

Closes #2918.

2 years agoGithub now supports .git-blame-ignore-revs (GH-2948)
Richard Si [Wed, 23 Mar 2022 17:31:13 +0000 (13:31 -0400)]
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

2 years agostub style: remove some possible future changes (#2940)
Jelle Zijlstra [Mon, 21 Mar 2022 22:20:41 +0000 (15:20 -0700)]
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.

2 years agodont skip formatting #%% (#2919)
Marco Edward Gorelli [Mon, 21 Mar 2022 21:51:07 +0000 (21:51 +0000)]
dont skip formatting #%% (#2919)

Fixes #2588

2 years agoUpdate pylint config docs (#2931)
Joseph Young [Wed, 16 Mar 2022 17:00:30 +0000 (17:00 +0000)]
Update pylint config docs (#2931)

2 years agoRemove power hugging formatting from preview (#2928)
Shivansh-007 [Wed, 16 Mar 2022 03:13:56 +0000 (08:43 +0530)]
Remove power hugging formatting from preview (#2928)

It is falsely placed in preview features and always formats the power operators, it was added in #2789 but there is no check for formatting added along with it.

2 years agoFarewell black-primer, it was nice knowing you (#2924)
Richard Si [Tue, 15 Mar 2022 19:57:59 +0000 (15:57 -0400)]
Farewell black-primer, it was nice knowing you (#2924)

Enjoy your retirement at https://github.com/cooperlees/black-primer

2 years agoBump mypy, flake8, and pre-commit-hooks in pre-commit (GH-2922)
Richard Si [Mon, 14 Mar 2022 23:41:46 +0000 (19:41 -0400)]
Bump mypy, flake8, and pre-commit-hooks in pre-commit (GH-2922)

2 years agoUse tomllib on Python 3.11 (#2903)
Shantanu [Tue, 8 Mar 2022 16:47:51 +0000 (08:47 -0800)]
Use tomllib on Python 3.11 (#2903)

2 years agoFix handling of Windows junctions in normalize_path_maybe_ignore (#2904)
yoerg [Tue, 8 Mar 2022 15:28:13 +0000 (16:28 +0100)]
Fix handling of Windows junctions in normalize_path_maybe_ignore (#2904)

Fixes #2569

2 years agoBump actions/setup-python from 2 to 3 (#2908)
dependabot[bot] [Mon, 7 Mar 2022 20:33:25 +0000 (12:33 -0800)]
Bump actions/setup-python from 2 to 3 (#2908)

Bumps [actions/setup-python](https://github.com/actions/setup-python) from 2 to 3.
- [Release notes](https://github.com/actions/setup-python/releases)
- [Commits](https://github.com/actions/setup-python/compare/v2...v3)

---
updated-dependencies:
- dependency-name: actions/setup-python
  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>
Co-authored-by: Cooper Lees <me@cooperlees.com>
2 years agoBump actions/checkout from 2 to 3 (#2909)
dependabot[bot] [Mon, 7 Mar 2022 16:44:01 +0000 (08:44 -0800)]
Bump actions/checkout from 2 to 3 (#2909)

Bumps [actions/checkout](https://github.com/actions/checkout) from 2 to 3.
- [Release notes](https://github.com/actions/checkout/releases)
- [Changelog](https://github.com/actions/checkout/blob/main/CHANGELOG.md)
- [Commits](https://github.com/actions/checkout/compare/v2...v3)

---
updated-dependencies:
- dependency-name: actions/checkout
  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>
2 years agoAllow `for`'s target expression to be starred (#2879)
Batuhan Taskaya [Sat, 5 Mar 2022 01:37:16 +0000 (04:37 +0300)]
Allow `for`'s target expression to be starred (#2879)

Fixes #2878

2 years agoBump furo from 2022.2.14.1 to 2022.3.4 in /docs (#2906)
dependabot[bot] [Sat, 5 Mar 2022 00:48:53 +0000 (16:48 -0800)]
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>
2 years agoMove test for g:load_black to improve plugin performance (GH-2896)
oncomouse [Sat, 5 Mar 2022 00:15:39 +0000 (18:15 -0600)]
Move test for g:load_black to improve plugin performance (GH-2896)

If a vim/neovim user wishes to suppress loading the vim plugin by
setting g:load_black in their VIMRC (for me, Arch linux automatically
adds the plugin to Neovim's RTP, even though I'm not using it), the
current location of the test comes after a call to has('python3'). This
adds, in my tests, between 35 and 45 ms to Vim load time (which I know
isn't a lot but it's also unnecessary). Moving the call to
`exists('g:load_black')` to before the call to `has('python3')` removes
this unnecessary test and speeds up loading.

Co-authored-by: Richard Si <63936253+ichard26@users.noreply.github.com>
2 years agoreplace md5 with sha256 (#2905)
Tomáš Jelínek [Thu, 3 Mar 2022 17:29:48 +0000 (18:29 +0100)]
replace md5 with sha256 (#2905)

MD5 is unavailable on systems with active FIPS mode. That makes black
crash when run on such systems.

2 years agoREADME: fix "Pragmatism" link target (#2901)
Shantanu [Tue, 1 Mar 2022 04:13:34 +0000 (20:13 -0800)]
README: fix "Pragmatism" link target (#2901)

Fixes #2897

2 years agofix new formatting issue (#2895)
Jelle Zijlstra [Thu, 24 Feb 2022 03:41:42 +0000 (19:41 -0800)]
fix new formatting issue (#2895)

Race between #2889 and another PR.

2 years agoseparate CHANGELOG section for preview style (#2890)
Jelle Zijlstra [Thu, 24 Feb 2022 02:32:00 +0000 (18:32 -0800)]
separate CHANGELOG section for preview style (#2890)

2 years agoFormat ourselves in preview mode (#2889)
Jelle Zijlstra [Thu, 24 Feb 2022 02:20:59 +0000 (18:20 -0800)]
Format ourselves in preview mode (#2889)

2 years agoBump furo from 2022.1.2 to 2022.2.14.1 in /docs (GH-2892)
dependabot[bot] [Wed, 23 Feb 2022 17:00:06 +0000 (12:00 -0500)]
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>
2 years agoAdd special config verbose log case when black is using user-level config (#2861)
Shivansh-007 [Mon, 21 Feb 2022 01:59:36 +0000 (07:29 +0530)]
Add special config verbose log case when black is using user-level config (#2861)

2 years agocorrect Vim integration code (#2853)
D. Ben Knoble [Mon, 21 Feb 2022 01:37:07 +0000 (20:37 -0500)]
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.

2 years agoIsolate command line tests for notebooks from user-level config (#2854)
Frédérik Paradis [Mon, 21 Feb 2022 01:17:01 +0000 (20:17 -0500)]
Isolate command line tests for notebooks from user-level config (#2854)

2 years agoFix typo in file_collection_and_discovery.md (GH-2860)
Laurent Lyaudet [Fri, 11 Feb 2022 01:32:55 +0000 (02:32 +0100)]
Fix typo in file_collection_and_discovery.md (GH-2860)

"you your" -> "your"

Co-authored-by: Felix Hildén <felix.hilden@gmail.com>
2 years agoOrder the disabled error codes for pylint (GH-2870)
Xuan (Sean) Hu [Fri, 11 Feb 2022 01:31:28 +0000 (09:31 +0800)]
Order the disabled error codes for pylint (GH-2870)

Just make them alphabetical.

2 years agoAvoid crashing when the user has no homedir (#2814)
Joachim Jablon [Tue, 8 Feb 2022 20:13:58 +0000 (21:13 +0100)]
Avoid crashing when the user has no homedir (#2814)

2 years agoAdd Django in 'used by' section in Readme (#2875)
Paolo Melchiorre [Tue, 8 Feb 2022 19:38:39 +0000 (20:38 +0100)]
Add Django in 'used by' section in Readme (#2875)

* Add Django in 'used by' section in Readme

* Fix Readme issue

2 years agoBump sphinx-copybutton from 0.4.0 to 0.5.0 in /docs (#2871)
dependabot[bot] [Mon, 7 Feb 2022 15:31:58 +0000 (07:31 -0800)]
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>
2 years agoCreate indentation FAQ entry (#2855)
Felix Hildén [Wed, 2 Feb 2022 06:59:42 +0000 (08:59 +0200)]
Create indentation FAQ entry (#2855)

Co-authored-by: Jelle Zijlstra <jelle.zijlstra@gmail.com>
2 years agoUpdate description for GitHub Action `options:` argument (GH-2858)
Peter Mescalchin [Wed, 2 Feb 2022 03:17:45 +0000 (14:17 +1100)]
Update description for GitHub Action `options:` argument (GH-2858)

It was missing --diff as one of the default arguments passed.

2 years agoIsolate command line tests from user-level config (#2851)
Richard Si [Tue, 1 Feb 2022 05:29:01 +0000 (00:29 -0500)]
Isolate command line tests from user-level config (#2851)

2 years agoSurface links to Stability Policy (GH-2848)
S. Co1 [Tue, 1 Feb 2022 00:06:52 +0000 (19:06 -0500)]
Surface links to Stability Policy (GH-2848)

2 years agorelease process: formalize the changelog template (#2837)
Jelle Zijlstra [Sun, 30 Jan 2022 22:04:06 +0000 (14:04 -0800)]
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.

2 years agoSoft comparison of --required-version (#2832)
Frédérik Paradis [Sun, 30 Jan 2022 21:42:56 +0000 (16:42 -0500)]
Soft comparison of --required-version (#2832)

Co-authored-by: Jelle Zijlstra <jelle.zijlstra@gmail.com>
Co-authored-by: Felix Hildén <felix.hilden@gmail.com>
2 years agoExclude __pypackages__ by default (GH-2836)
Jelle Zijlstra [Sun, 30 Jan 2022 20:01:56 +0000 (12:01 -0800)]
Exclude __pypackages__ by default (GH-2836)

PDM uses this as part of not-accepted-yet PEP 582.

2 years agoAdjust `--preview` documentation (#2833)
Jelle Zijlstra [Sun, 30 Jan 2022 19:53:45 +0000 (11:53 -0800)]
Adjust `--preview` documentation (#2833)

2 years agoPrepare docs for release 22.1.0 (GH-2826)
Richard Si [Sat, 29 Jan 2022 19:30:25 +0000 (14:30 -0500)]
Prepare docs for release 22.1.0 (GH-2826)

2 years agoFix changelog entries in the wrong release (#2825)
Jelle Zijlstra [Sat, 29 Jan 2022 17:32:52 +0000 (09:32 -0800)]
Fix changelog entries in the wrong release (#2825)

2 years agoFix changelog entries in the wrong release (#2825)
Jelle Zijlstra [Sat, 29 Jan 2022 17:32:26 +0000 (09:32 -0800)]
Fix changelog entries in the wrong release (#2825)

2 years agoRemove test suite from setup.py (#2824)
Jelle Zijlstra [Sat, 29 Jan 2022 16:00:59 +0000 (08:00 -0800)]
Remove test suite from setup.py (#2824)

We no longer use it

2 years agoUpdate classifiers to reflect stable (#2823)
Richard Si [Sat, 29 Jan 2022 15:37:51 +0000 (10:37 -0500)]
Update classifiers to reflect stable (#2823)

2 years agoAdd a test case to torture.py (#2822)
Shantanu [Sat, 29 Jan 2022 03:38:50 +0000 (19:38 -0800)]
Add a test case to torture.py (#2822)

Co-authored-by: hauntsaninja <>
2 years agoFix instability due to trailing comma logic (#2572)
Nipunn Koorapati [Sat, 29 Jan 2022 02:13:18 +0000 (18:13 -0800)]
Fix instability due to trailing comma logic (#2572)

It was causing stability issues because the first pass
could cause a "magic trailing comma" to appear, meaning
that the second pass might get a different result. It's
not critical.

Some things format differently (with extra parens)

2 years agoFix arithmetic stability issue (#2817)
Shantanu [Sat, 29 Jan 2022 00:57:05 +0000 (16:57 -0800)]
Fix arithmetic stability issue (#2817)

It turns out "simple_stmt" isn't that simple: it can contain multiple
statements separated by semicolons. Invisible parenthesis logic for
arithmetic expressions only looked at the first child of simple_stmt.
This causes instability in the presence of semicolons, since the next
run through the statement following the semicolon will be the first
child of another simple_stmt.

I believe this along with #2572 fix the known stability issues.

2 years agoFormalise style preference description (#2818)
Felix Hildén [Sat, 29 Jan 2022 00:49:43 +0000 (02:49 +0200)]
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).

2 years agotorture test (#2815)
Jelle Zijlstra [Sat, 29 Jan 2022 00:48:38 +0000 (16:48 -0800)]
torture test (#2815)

Fixes #2651. Fixes #2754. Fixes #2518. Fixes #2321.

This adds a test that lists a number of cases of unstable formatting
that we have seen in the issue tracker. Checking it in will ensure
that we don't regress on these cases.

2 years agoTreat blank lines in stubs the same inside top-level `if` statements (#2820)
Shantanu [Sat, 29 Jan 2022 00:29:07 +0000 (16:29 -0800)]
Treat blank lines in stubs the same inside top-level `if` statements (#2820)

2 years agoElaborate on Python support policy (#2819)
Felix Hildén [Fri, 28 Jan 2022 18:58:17 +0000 (20:58 +0200)]
Elaborate on Python support policy (#2819)

2 years agoreorganize release notes for 22.1.0 (#2790)
Jelle Zijlstra [Fri, 28 Jan 2022 14:25:24 +0000 (06:25 -0800)]
reorganize release notes for 22.1.0 (#2790)

Co-authored-by: Richard Si <63936253+ichard26@users.noreply.github.com>
2 years agoTests for unicode identifiers (#2816)
Shantanu [Fri, 28 Jan 2022 08:16:25 +0000 (00:16 -0800)]
Tests for unicode identifiers (#2816)

2 years agoUse parentheses on method access on float and int literals (#2799)
Shivansh-007 [Fri, 28 Jan 2022 05:31:50 +0000 (11:01 +0530)]
Use parentheses on method access on float and int literals (#2799)

Co-authored-by: Jelle Zijlstra <jelle.zijlstra@gmail.com>
Co-authored-by: Felix Hildén <felix.hilden@gmail.com>
2 years agomore trailing comma tests (#2810)
Jelle Zijlstra [Thu, 27 Jan 2022 03:44:39 +0000 (19:44 -0800)]
more trailing comma tests (#2810)

2 years agoblack-primer: stop running it (#2809)
Jelle Zijlstra [Thu, 27 Jan 2022 01:18:43 +0000 (17:18 -0800)]
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.

2 years agoFix crash on some power hugging cases (#2806)
Jelle Zijlstra [Thu, 27 Jan 2022 00:47:36 +0000 (16:47 -0800)]
Fix crash on some power hugging cases (#2806)

Found by the fuzzer. Repro case:

python -m black -c 'importA;()<<0**0#'

2 years agoproperly run ourselves twice (#2807)
Jelle Zijlstra [Tue, 25 Jan 2022 23:58:58 +0000 (15:58 -0800)]
properly run ourselves twice (#2807)

The previous run-twice logic only affected the stability checks but not the output. Now, we actually output the twice-formatted code.