Commit Graph

1059 Commits

Author SHA1 Message Date
Konstantin Alekseev
5446a92f01
Use vim autoload script (#1157) 2021-03-07 16:13:25 -08:00
Richard Si
b332cfa655
Add missing changelog entry for fmt: skip (#2025) 2021-03-06 12:02:25 -08:00
John Meow
1f7e73506c
Add ALE (#1753) 2021-03-05 20:22:19 -08:00
Hadi Alqattan
b3ceb293d9
Remove unused import statements using Pycln. (#2021)
* remove unused imports using Pycln.

* reverse comma style.
2021-03-05 11:58:00 -08:00
dependabot[bot]
12f98219bc
Bump aiohttp from 3.7.3 to 3.7.4 (#2009)
Bumps [aiohttp](https://github.com/aio-libs/aiohttp) from 3.7.3 to 3.7.4.
- [Release notes](https://github.com/aio-libs/aiohttp/releases)
- [Changelog](https://github.com/aio-libs/aiohttp/blob/master/CHANGES.rst)
- [Commits](https://github.com/aio-libs/aiohttp/compare/v3.7.3...v3.7.4)

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

Co-authored-by: dependabot[bot] <49699333+dependabot[bot]@users.noreply.github.com>
2021-03-05 10:43:54 -08:00
Hugo van Kemenade
24418a5450
Black requires Python 3.6.2+ (#1668) 2021-03-04 05:59:31 -08:00
Utkarsh Gupta
e293473ea9
Add formatters-python for atom to editor_integration (#1834) 2021-03-03 16:46:27 -08:00
Joshua Cannon
e3c71c3a47
Turn test_regex into a click callback (#2016)
Co-authored-by: Richard Si <63936253+ichard26@users.noreply.github.com>
2021-03-02 17:21:50 -08:00
Austin Pray
cac18293d5
Adds --stdin-filename back to changelog (#2017)
* Adds --stdin-filename back to changelog

Looks like this went missing dea81b7ad5 (diff-729efdd61772b108539268bdbfd7472521bdc05a7cae6113f62ed2649a3ad9c7)

* Update CHANGES.md

Co-authored-by: Jelle Zijlstra <jelle.zijlstra@gmail.com>

* Update CHANGES.md

Co-authored-by: Jelle Zijlstra <jelle.zijlstra@gmail.com>

Co-authored-by: Jelle Zijlstra <jelle.zijlstra@gmail.com>
2021-03-01 16:35:57 -08:00
Joshua Cannon
beecd6fd0a
Add --extend-exclude parameter (#2005)
Look ma! I contribute to open source!

Co-authored-by: Richard Si <63936253+ichard26@users.noreply.github.com>
2021-03-01 14:07:36 -08:00
Rishav Kundu
858225d34d
Strip redundant parentheses from assignment exprs (#1906)
Fixes #1656
2021-02-27 17:20:23 -08:00
tpilewicz
b06cd15666
Wrap arithmetic and binary arithmetic expressions in invisible parentheses (#2001) 2021-02-24 03:56:56 -08:00
James Addison
e1c86f987e
Fuzzer testing: less strict special-case regex match passthrough for multi-line EOF exceptions (#1998) 2021-02-22 07:49:38 -08:00
James Addison
fe4a9d6bee
Fixup: update function name in docs to match source (#1997) 2021-02-22 07:46:38 -08:00
James
24e8dad575
Fix for enum changes in 3.10 (#1999) 2021-02-22 07:42:05 -08:00
Paul "TBBle" Hampson
cd4295dd98
Indicate that a final newline was added in --diff (#1897) (#1897)
Fixes: #1662

Work-around for https://bugs.python.org/issue2142

The test has to slightly mess with its input data, because the utility
functions default to ensuring the test data has a final newline, which
defeats the point of the test.

Signed-off-by: Paul "TBBle" Hampson <Paul.Hampson@Pobox.com>
2021-02-21 22:43:23 -08:00
James Addison
0cbe19c813 Minimize changes: more closely resemble original conditional logic 2021-02-20 19:36:21 +01:00
James Addison
22127c633e Readability: reduce boolean nesting 2021-02-20 19:36:21 +01:00
James Addison
24700806f6 Cleanup: remove unused / redundant variables from conditionals 2021-02-20 19:36:21 +01:00
James Addison
e0d766727d Simplification: only yield empty omit list when magic trailing comma is present 2021-02-20 19:36:21 +01:00
James Addison
829331a877 Simplification: only use special-case token retrieval logic when magic trailing comma is present 2021-02-20 19:36:21 +01:00
James Addison
89c42a0011 Clarity: special case: avoid using variables that have the same names as methods 2021-02-20 19:36:21 +01:00
James Addison
51141f1af4 Consistency: use variable names that correspond to the methods they invoke 2021-02-20 19:36:21 +01:00
James Addison
a23f521fee Brevity: only use the variables required to convey the intended expressions 2021-02-20 19:36:21 +01:00
James Addison
caa3fcc2de Clarity: isolate and extract each responsibility from an overloaded variable 2021-02-20 19:36:21 +01:00
James Addison
afc8c326bf Brevity: rename method 2021-02-20 19:36:21 +01:00
James Addison
306a513137
fuzzer: add special-case for multi-line EOF TokenError (#1991)
* Add special-case for multi-line EOF TokenError under Python3.7

* Update conditional check to correspond to original issue description (and include issue hyperlink)

* Add warning and hint regarding replaying the fuzzer code generation

* Include code review suggestion (with modifications for this to follow)

Co-authored-by: Zac Hatfield-Dodds <zac.hatfield.dodds@gmail.com>

* Remove Python version check, since this issue does exist across more recent Python versions than 3.7

* Update explanatory comment

* Add clarification for potentially-ambiguous blib2to3 import

* Update explanatory comment

* Bring comment into consistent format with previous comment

* Revert "Add clarification for potentially-ambiguous blib2to3 import"

This reverts commit 357b7cc03bdb19dd924f1accd428352f4bb44e5c.

Co-authored-by: Zac Hatfield-Dodds <zac.hatfield.dodds@gmail.com>
2021-02-20 08:44:48 -08:00
Romain Rigaux
97b8496d67
Use 'args' to Avoid GH workflow warning (#1990)
Unexpected input(s) 'black_args', valid inputs are ['entryPoint', 'args']
2021-02-16 13:10:23 -08:00
Archit Gopal
71bbb678b9
add gedit integration (#1988) 2021-02-15 08:05:23 -08:00
Sagi Shadur
6a105e019f
Add "# fmt: skip" directive to black (#1800)
Fixes #1162
2021-02-15 08:02:48 -08:00
rht
3a309a36fc
readme: Include Zulip in used-by section (#1987)
Zulip has recently formatted their code in Black and also set Black as a linter: https://github.com/zulip/zulip/pull/15662.
See also https://chat.zulip.org/#narrow/stream/2-general/topic/black.
2021-02-14 07:32:29 -08:00
Richard Si
76268ab0c9
Fix duplication of checks on internal PRs (#1986)
Internal PRs (that come from branches of psf/black) match both the push
and pull_request events. This leads to a duplication of test, lint, etc.
checks on such PRs. Not only is it a waste of resources, it makes the
Status Checks UI more frustrating to go through.

Patch taken from:
https://github.community/t/duplicate-checks-on-push-and-pull-request-simultaneous-event/18012
2021-02-14 07:23:47 -08:00
James Addison
b8c1020b52
Stability fixup: interaction between newlines and comments (#1975)
* Add test case to illustrate the issue

* Accept carriage returns as valid separators while enumerating comments

Without this acceptance, escaped multi-line statments that use carriage returns will not be counted into the 'ignored_lines' variable since the emitted line values will end with a CR and not an escape character.  That leads to comments associated with the line being incorrectly labeled with the STANDALONE_COMMENT type, affecting comment placement and line space management.

* Remove comment linking to ephemeral build log
2021-02-11 12:11:42 -08:00
dependabot[bot]
2d0c14989d
Bump cryptography from 3.3.1 to 3.3.2 (#1981)
Bumps [cryptography](https://github.com/pyca/cryptography) from 3.3.1 to 3.3.2.
- [Release notes](https://github.com/pyca/cryptography/releases)
- [Changelog](https://github.com/pyca/cryptography/blob/master/CHANGELOG.rst)
- [Commits](https://github.com/pyca/cryptography/compare/3.3.1...3.3.2)

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

Co-authored-by: dependabot[bot] <49699333+dependabot[bot]@users.noreply.github.com>
2021-02-09 18:17:23 -08:00
James Addison
1c364f42ee
Regenerate documentation (#1980)
Resolves #1979 and ensures that the content from #1861 is included in the repository-published documentation.
2021-02-09 17:10:02 -08:00
Richard Si
aebd3c37b2
Update prettier in pre-commit config (#1966)
With older versions of prettier, when the hook failed a bunch of
"[error] No parser could be inferred for file: {PATH}" error lines
showed up because of lack of support of a flag that pre-commit
passes for us by default. It made figuring out why the prettier hook
failed annoying.
2021-02-04 20:10:45 -08:00
Anthony Sottile
3fca540d05
speed up cache by approximately 42x by avoiding pathlib (#1953) 2021-02-04 13:03:42 -08:00
dependabot[bot]
df4dd38a9a
Bump bleach from 3.2.1 to 3.3.0 (#1957)
Bumps [bleach](https://github.com/mozilla/bleach) from 3.2.1 to 3.3.0.
- [Release notes](https://github.com/mozilla/bleach/releases)
- [Changelog](https://github.com/mozilla/bleach/blob/master/CHANGES)
- [Commits](https://github.com/mozilla/bleach/compare/v3.2.1...v3.3.0)

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

Co-authored-by: dependabot[bot] <49699333+dependabot[bot]@users.noreply.github.com>
2021-02-02 15:54:14 -08:00
James Addison
988c686d31
Remove placeholder exit code in unreachable 'black-primer' subprocess handler (#1952) 2021-02-01 09:54:19 -08:00
Oliver Newman
71117e730c
Update example exclude to match only files in root (#1861)
* Update example exclude to match only files in root

The `exclude` section of the example `pyproject.toml` file didn't work
as expected. It claimed to exclude matched files only in the project
root, but it actually excluded matched files at any directory level
within the project. We can address this by prepending `^/` to the regex
to ensure that it only matches files in the project root.

See https://github.com/psf/black/issues/1473#issuecomment-740008873 for
explanation.

* Mention excluding directories as well
2021-01-27 09:36:21 -08:00
Shantanu
692c0f50d9
Add --skip-magic-trailing-comma (#1824) 2021-01-17 16:59:06 -08:00
Zac Hatfield-Dodds
de510478d9
OSS-Fuzz integration (#1930) 2021-01-15 16:05:15 -08:00
Emilv2
e8aadedd97
Fix typo (#1931) 2021-01-15 14:43:23 -08:00
Peter Stensmyr
b55fb821e7
Update link pointing to how-black-wraps-lines (#1925)
The section about the Black code style has been moved to its own file.
Update link on the compatible configs page to point to the right place.
2021-01-14 15:57:45 -08:00
Cooper Lees
4310f39bd9
Update Contributing Docs (#1915)
* Update Contributing Docs
- Update docs with all new tox hotness
- Test running docs build:
  - `sphinx-build -a -b html -W docs/ docs/_build/`

Fixes #1907

* Fix docs/contributing_to_black.md lint

* Remove autogenerated copy pasta

* Fix review typos + regen automated docs via Running Sphinx v1.8.5
2021-01-13 15:17:30 -08:00
Thomas Hagebols
3d06894707
Set gh action entrypoint interpreter to bash (#1919) 2021-01-11 08:23:11 -08:00
Shota Ray Imaki
ce269d2da5
fix #1917 (#1918) 2021-01-11 08:21:14 -08:00
Troy Murray
a81702ce02
Changed max workers on windows to 60 (#1912) 2021-01-08 12:26:42 -08:00
Rick Staa
ba3648d984
Release gh action (#1909)
* Gets gh-action ready for marketplace release

* Updates documentation and removes redundant gh-action input argument

* Fixes gh-action bug

This commit fixes a bug which caused not all input arguments were forwarder to the black formatter.

* Update README.md

Co-authored-by: Cooper Lees <me@cooperlees.com>

Co-authored-by: Cooper Lees <me@cooperlees.com>
2021-01-08 11:47:03 -08:00
Taneli Hukkinen
966baaacbc
Only require typing-extensions if Python < 3.8 (#1873) 2021-01-03 08:14:59 -08:00