Commit Graph

1990 Commits

Author SHA1 Message Date
Jelle Zijlstra
4f47cac192
Add --unstable flag (#4096) 2024-01-25 17:00:47 -08:00
Daniel Krzeminski
bccec8adfb
Show warning on invalid toml configuration (#4165)
Co-authored-by: Jelle Zijlstra <jelle.zijlstra@gmail.com>
2024-01-25 16:41:37 -08:00
Shantanu
7d789469ed
Describe 2024 module docstring more accurately (#4168) 2024-01-25 16:15:18 -08:00
Shantanu
17f7f297ef
Simplify code in lines.py (#4167)
This has been getting a little messy. These changes neaten things up, we
don't have to keep guarding against `self.previous_line is not None`, we
make it clearer what logic has side effects, we reduce the amount of
code that tricky `before` could touch, etc
2024-01-25 13:41:45 -08:00
Shantanu
f7d552d9b7
Remove reference (#4169)
This is out-of-date and just a chore. I don't think this is useful to
contributors and Black doesn't even have a public API.
2024-01-25 13:11:26 -08:00
cobalt
a5196e6f1f
fix: Don't normalize whitespace before fmt:skip comments (#4146)
Signed-off-by: RedGuy12 <paul@reid-family.org>
2024-01-25 01:31:49 -08:00
Jelle Zijlstra
59b9d858a3
Create the 2024 stable style (#4106) 2024-01-24 17:06:14 -08:00
Daniel Krzeminski
8fe602b1fa
fix pathlib exception handling with symlinks (#4161)
Fixes #4077
2024-01-22 09:46:57 -08:00
dependabot[bot]
6f3fb78444
Bump actions/cache from 3 to 4 (#4162)
Bumps [actions/cache](https://github.com/actions/cache) from 3 to 4.
- [Release notes](https://github.com/actions/cache/releases)
- [Changelog](https://github.com/actions/cache/blob/main/RELEASES.md)
- [Commits](https://github.com/actions/cache/compare/v3...v4)

---
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>
2024-01-22 09:22:56 -08:00
Shantanu
995e4ada14
Fix unnecessary nesting when wrapping long dict (#4135)
Fixes #4129
2024-01-19 17:13:26 -08:00
Kevin Paulson
7f60f3dbd7
Update using_black_with_other_tools.md to ensure flake8 configuration examples are consistant (#4157) 2024-01-19 15:54:32 -08:00
cobalt
9a331d606f
fix: Don't allow unparenthesizing walruses (#4155)
Signed-off-by: RedGuy12 <61329810+RedGuy12@users.noreply.github.com>
Signed-off-by: RedGuy12 <paul@reid-family.org>
2024-01-17 11:04:15 -08:00
Dragorn421
b7c3a9fedd
Docs: Add note on --exclude about possibly verbose regex (#4145)
Co-authored-by: Jelle Zijlstra <jelle.zijlstra@gmail.com>
2024-01-11 07:46:17 -08:00
Shantanu
e11eaf2f44
Make blank_line_after_nested_stub_class work for methods (#4141)
Fixes #4113

Authored by dhruvmanila
2024-01-01 20:14:57 -08:00
Shantanu
b1d17ef9a2
Fix comment handling when parenthesising conditional expressions (#4134)
Fixes #3555
2024-01-01 17:55:11 -08:00
Shantanu
4ceed0b958
Remove is_function_or_class helper footgun (#4133)
This is a no-op change.

That function was not a good way to tell if something is a function or a
class, since it basically only worked for async functions by accident
(the parent of a suite / simple_stmt of async function body is a
funcdef).
2024-01-01 17:36:49 -08:00
Shantanu
269190274b
Clean up dead code in magic trailing comma logic (#4131) 2024-01-01 17:29:21 -08:00
Shantanu
8e0a9dee1b
Remove empty lines before docstrings in async functions (#4132) 2024-01-01 16:56:39 -08:00
Shantanu
b9ad4da2e8
Revert "confine pre-commit to stages (#3940)" (#4137)
This reverts commit 7686989fc8.
2024-01-01 16:55:25 -08:00
Shantanu
fe3376141c
Allow empty lines at beginnings of more blocks (#4130)
Fixes #4043, fixes #619

These include nested functions and methods.

I think the nested function case quite clearly improves readability. I
think the method case improves consistency, adherence to PEP 8 and
resolves a point of contention.
2024-01-01 15:46:09 -08:00
pre-commit-ci[bot]
c35924663c
[pre-commit.ci] pre-commit autoupdate (#4139) 2024-01-01 15:12:18 -08:00
Jelle Zijlstra
db9c592967
Unify docstring detection (#4095)
Co-authored-by: hauntsaninja <hauntsaninja@gmail.com>
2023-12-27 22:59:30 -08:00
Shantanu
bf6cabc804
Do not round cache mtimes (#4128)
Fixes #4116

This logic was introduced in #3821, I believe as a result of copying
logic inside mypy that I think isn't relevant to Black
2023-12-27 22:24:57 -08:00
cobalt
c80685f361
Treat walruses like other binary operators in subscripts (#4109)
Fixes #4078
2023-12-27 22:24:25 -08:00
Anupya Pamidimukkala
51786141cc
Fix nits, chain comparisons, unused params, hyphens (#4114) 2023-12-27 22:23:42 -08:00
Cooper Lees
1b831f214a
Add new changelog template (#4125) 2023-12-22 15:46:06 -08:00
Cooper Lees
ec91a2be3c
Prepare release 23.12.1 (#4124) 2023-12-22 15:04:32 -08:00
Bryce Willey
8fec1c3085
Adds paren to deps for hidden extra constraint (#4108)
Fix #4107
2023-12-14 00:28:28 -08:00
Jelle Zijlstra
35ce37ded7 Add new changelog template 2023-12-11 22:28:46 -08:00
Jelle Zijlstra
d9ad09a32b
Prepare release 23.12.0 (#4105) 2023-12-11 21:55:28 -08:00
Jelle Zijlstra
ebd543c0ac
Fix feature detection for parenthesized context managers (#4104) 2023-12-11 21:37:15 -08:00
Jelle Zijlstra
eb7661f8ab
Fix another case where we format dummy implementation for non-functions/classes (#4103) 2023-12-11 14:41:41 -08:00
Jelle Zijlstra
0c9899956d
Fix path in test message (#4102) 2023-12-11 14:29:33 -08:00
Jelle Zijlstra
9aea9768cb
Only use dummy implementation logic for functions and classes (#4066)
Fixes #4063
2023-12-11 13:19:02 -08:00
dependabot[bot]
67b23d7185
Bump actions/setup-python from 4 to 5 (#4101) 2023-12-11 11:32:04 -08:00
Jelle Zijlstra
ce28be2705
Add dedicated preview feature for East Asian Width (#4097) 2023-12-09 21:14:25 -08:00
Jelle Zijlstra
61b529b7d1
Allow empty lines at beginning of blocks (again) (#4060) 2023-12-09 18:29:09 -08:00
cobalt
e7e122e9ff
docs: Move fmt: off docs (#4090) 2023-12-09 17:44:15 -08:00
cobalt
432d9050c3
docs: Unify option descriptions between --help and the_basics.md (#4076) 2023-12-07 09:32:06 -08:00
cobalt
50e287cece
docs: Clarify include/exclude documentation (#4072) 2023-12-07 08:38:57 -08:00
John Litborn
e4ae213f06
test preview cases with line-length 1 unless explicitly skipped (#4087)
* Add new flag for tests, --no-preview-line-length-1, to be used for test cases known to not work in preview mode with line-length=1. Also split out the problematic cases in three cases to separate files. Removed now redundant file which explicitly tested preview annotations with line-length=1

* mode.preview -> preview_mode, mark pep_572_remove_parens as failing with ll1
2023-12-06 07:17:33 -08:00
John Litborn
50d5756e8e
fix crash in preview mode with --line-length=1 (#4086) 2023-12-05 10:19:24 -08:00
Riyazuddin Khan
3416b2c82d
Fix: --line-ranges dedents a # fmt: off in the middle of a decorator (#4084)
Fixes #4068
2023-12-04 10:10:03 -08:00
exag
66ec056e39
Fix minor typos in docstrings (#4085) 2023-12-03 21:47:30 -08:00
Alex Waygood
a0e270d0f2
Build mypycified wheels for Python 3.12 (#4070) 2023-11-24 10:05:59 -08:00
Alex Waygood
69d49c5a6f
Bump mypy to 1.7.1 (#4069) 2023-11-24 06:19:54 -08:00
Henri Holopainen
fb5e5d2be6
Prefer more equal signs before a break when splitting chained assignments (#4010)
Fixes #4007
2023-11-22 19:11:49 -08:00
Jelle Zijlstra
be336bb67f
Run lint job on Ubuntu only (#4061) 2023-11-20 22:33:16 -08:00
Yilei Yang
a8062983cd
Disable the stability check with --line-ranges for now. (#4034)
Co-authored-by: Jelle Zijlstra <jelle.zijlstra@gmail.com>
2023-11-20 20:45:39 -08:00
tungol
89e28ea66f
Permit standalone form feed characters at the module level (#4021)
Co-authored-by: Stephen Morton <git@tungol.org>
Co-authored-by: Jelle Zijlstra <jelle.zijlstra@gmail.com>
2023-11-20 20:44:33 -08:00