Skip to content
New issue

Have a question about this project? Sign up for a free GitHub account to open an issue and contact its maintainers and the community.

By clicking “Sign up for GitHub”, you agree to our terms of service and privacy statement. We’ll occasionally send you account related emails.

Already on GitHub? Sign in to your account

Add --unstable flag #4096

Merged
merged 53 commits into from
Jan 26, 2024
Merged
Show file tree
Hide file tree
Changes from 1 commit
Commits
Show all changes
53 commits
Select commit Hold shift + click to select a range
18e711f
Allow empty lines at beginning of blocks (again)
JelleZijlstra Nov 21, 2023
d753703
reformat
JelleZijlstra Nov 21, 2023
129349c
update comments
JelleZijlstra Nov 21, 2023
51bb901
Many uncontroverisal preview changes
JelleZijlstra Nov 21, 2023
c71b5e2
more relatively noncontroversial features
JelleZijlstra Nov 21, 2023
cc3780f
Update some tests
JelleZijlstra Nov 21, 2023
bb31678
Enable two more
JelleZijlstra Nov 21, 2023
337a85d
Merge branch 'main' into 241a1really
JelleZijlstra Dec 10, 2023
37f8ed0
Remove obsolete features
JelleZijlstra Dec 10, 2023
be46470
Fix up merge
JelleZijlstra Dec 10, 2023
7712a74
Add --unstable flag
JelleZijlstra Dec 10, 2023
6238e38
self
JelleZijlstra Dec 10, 2023
47221c9
fine
JelleZijlstra Dec 10, 2023
3fd83e0
Merge branch 'main' into 241a1really
JelleZijlstra Dec 11, 2023
6e8871b
Fix the worst issues
JelleZijlstra Dec 11, 2023
10f6449
fix some tests
JelleZijlstra Dec 11, 2023
c27daf6
Update tests
JelleZijlstra Dec 11, 2023
dc2d104
Fix another dummy impl case
JelleZijlstra Dec 11, 2023
b073cbd
fix some more
JelleZijlstra Dec 11, 2023
034fd94
Merge branch 'main' into 241a1really
JelleZijlstra Dec 11, 2023
acb8c7c
unused imports
JelleZijlstra Dec 11, 2023
27c8a34
Fix feature detection for parenthesized CMs
JelleZijlstra Dec 12, 2023
0302e8d
changelog
JelleZijlstra Dec 12, 2023
6794240
Merge branch 'main' into 241a1really
JelleZijlstra Dec 12, 2023
9886590
Merge remote-tracking branch 'upstream/main' into black24
JelleZijlstra Jan 4, 2024
7f7eb72
Fix up
JelleZijlstra Jan 4, 2024
280ec86
Merge branch 'main' into black24
JelleZijlstra Jan 24, 2024
975e7f1
wrap_long_dict_values_in_parens and multiline_string_handling back to…
JelleZijlstra Jan 24, 2024
073ee3f
bad merge
JelleZijlstra Jan 24, 2024
8758f3c
fix tests
JelleZijlstra Jan 24, 2024
a9ca9a4
fix more tests
JelleZijlstra Jan 24, 2024
47449ff
Remove --preview from some tests
JelleZijlstra Jan 24, 2024
a646358
changelog
JelleZijlstra Jan 24, 2024
c4f42c6
Merge branch 'main' into unstable
JelleZijlstra Jan 24, 2024
5d2d735
Merge branch 'black24' into unstable
JelleZijlstra Jan 24, 2024
7836fb9
docs, blackd
JelleZijlstra Jan 24, 2024
5eaba4a
Format ourselves unstably
JelleZijlstra Jan 24, 2024
718ce47
fix test
JelleZijlstra Jan 24, 2024
27bcbc5
Merge branch 'main' into unstable
JelleZijlstra Jan 25, 2024
5411e74
Merge branch 'main' into unstable
JelleZijlstra Jan 25, 2024
cb9bc00
one more
JelleZijlstra Jan 25, 2024
9bfeae2
Add separate flags for --unstable features
JelleZijlstra Jan 25, 2024
9389390
Clean up obsolete preview tests
JelleZijlstra Jan 25, 2024
07eccbe
docs, blackd
JelleZijlstra Jan 25, 2024
81ab9cc
some tests
JelleZijlstra Jan 25, 2024
926bbde
[pre-commit.ci] auto fixes from pre-commit.com hooks
pre-commit-ci[bot] Jan 25, 2024
1755897
ugh 3.8
JelleZijlstra Jan 25, 2024
3a7310f
note replacement
JelleZijlstra Jan 25, 2024
a1b4dca
lint
JelleZijlstra Jan 25, 2024
47ea1d2
Remove broken and disabled test
JelleZijlstra Jan 25, 2024
e21787f
lint the lint
JelleZijlstra Jan 25, 2024
09c1fb5
Allow --enable-unstable-feature for preview features
JelleZijlstra Jan 26, 2024
9cc105b
Expand changelog
JelleZijlstra Jan 26, 2024
File filter

Filter by extension

Filter by extension

Conversations
Failed to load comments.
Loading
Jump to
Jump to file
Failed to load files.
Loading
Diff view
Diff view
Prev Previous commit
Next Next commit
Remove --preview from some tests
  • Loading branch information
JelleZijlstra committed Jan 24, 2024
commit 47449ff135a2f28c131f38b017a19689e18c3b7e
Original file line number Diff line number Diff line change
@@ -1,4 +1,3 @@
# flags: --preview
def foo():
"""
Docstring
Expand Down
Original file line number Diff line number Diff line change
@@ -1,4 +1,3 @@
# flags: --preview
async def func() -> (int):
return 0

Expand Down
11 changes: 6 additions & 5 deletions tests/data/cases/conditional_expression.py
Original file line number Diff line number Diff line change
@@ -1,4 +1,3 @@
# flags: --preview
long_kwargs_single_line = my_function(
foo="test, this is a sample value",
bar=some_long_value_name_foo_bar_baz if some_boolean_variable else some_fallback_value_foo_bar_baz,
Expand Down Expand Up @@ -197,7 +196,9 @@ def foo(wait: bool = True):
time.sleep(1) if wait else None


a = "".join((
"", # comment
"" if True else "",
))
a = "".join(
(
"", # comment
"" if True else "",
)
)
Original file line number Diff line number Diff line change
@@ -1,4 +1,4 @@
# flags: --preview --minimum-version=3.8
# flags: --minimum-version=3.8
with \
make_context_manager1() as cm1, \
make_context_manager2() as cm2, \
Expand Down
Original file line number Diff line number Diff line change
@@ -1,4 +1,4 @@
# flags: --preview --minimum-version=3.9
# flags: --minimum-version=3.9
with \
make_context_manager1() as cm1, \
make_context_manager2() as cm2, \
Expand Down
Original file line number Diff line number Diff line change
@@ -1,4 +1,4 @@
# flags: --preview --minimum-version=3.10
# flags: --minimum-version=3.10
# This file uses pattern matching introduced in Python 3.10.


Expand Down
Original file line number Diff line number Diff line change
@@ -1,4 +1,4 @@
# flags: --preview --minimum-version=3.11
# flags: --minimum-version=3.11
# This file uses except* clause in Python 3.11.


Expand Down
Original file line number Diff line number Diff line change
@@ -1,4 +1,3 @@
# flags: --preview
# This file doesn't use any Python 3.9+ only grammars.


Expand Down
Original file line number Diff line number Diff line change
@@ -1,4 +1,4 @@
# flags: --preview --minimum-version=3.9
# flags: --minimum-version=3.9
# This file uses parenthesized context managers introduced in Python 3.9.


Expand Down
Original file line number Diff line number Diff line change
@@ -1,4 +1,3 @@
# flags: --preview
from typing import NoReturn, Protocol, Union, overload

class Empty:
Expand Down
Original file line number Diff line number Diff line change
@@ -1,4 +1,3 @@
# flags: --preview


# Warning! This file contains form feeds (ASCII 0x0C, often represented by \f or ^L).
Expand Down
1 change: 0 additions & 1 deletion tests/data/cases/module_docstring_1.py
Original file line number Diff line number Diff line change
@@ -1,4 +1,3 @@
# flags: --preview
"""Single line module-level docstring should be followed by single newline."""


Expand Down
4 changes: 2 additions & 2 deletions tests/data/cases/module_docstring_2.py
Original file line number Diff line number Diff line change
@@ -1,7 +1,7 @@
# flags: --preview
"""I am a very helpful module docstring.

With trailing spaces:
With trailing spaces (only removed with unify_docstring_detection on):
Lorem ipsum dolor sit amet, consectetur adipiscing elit,
sed do eiusmod tempor incididunt ut labore et dolore magna aliqua.
Ut enim ad minim veniam,
Expand Down Expand Up @@ -39,7 +39,7 @@
# output
"""I am a very helpful module docstring.

With trailing spaces:
With trailing spaces (only removed with unify_docstring_detection on):
Lorem ipsum dolor sit amet, consectetur adipiscing elit,
sed do eiusmod tempor incididunt ut labore et dolore magna aliqua.
Ut enim ad minim veniam,
Expand Down
1 change: 0 additions & 1 deletion tests/data/cases/module_docstring_3.py
Original file line number Diff line number Diff line change
@@ -1,4 +1,3 @@
# flags: --preview
"""Single line module-level docstring should be followed by single newline."""
a = 1

Expand Down
1 change: 0 additions & 1 deletion tests/data/cases/module_docstring_4.py
Original file line number Diff line number Diff line change
@@ -1,4 +1,3 @@
# flags: --preview
"""Single line module-level docstring should be followed by single newline."""

a = 1
Expand Down
1 change: 0 additions & 1 deletion tests/data/cases/module_docstring_followed_by_class.py
Original file line number Diff line number Diff line change
@@ -1,4 +1,3 @@
# flags: --preview
"""Two blank lines between module docstring and a class."""
class MyClass:
pass
Expand Down
1 change: 0 additions & 1 deletion tests/data/cases/module_docstring_followed_by_function.py
Original file line number Diff line number Diff line change
@@ -1,4 +1,3 @@
# flags: --preview
"""Two blank lines between module docstring and a function def."""
def function():
pass
Expand Down
2 changes: 1 addition & 1 deletion tests/data/cases/nested_stub.py
Original file line number Diff line number Diff line change
@@ -1,4 +1,4 @@
# flags: --pyi --preview
# flags: --pyi
import sys

class Outer:
Expand Down
Original file line number Diff line number Diff line change
@@ -1,4 +1,4 @@
# flags: --preview --minimum-version=3.10
# flags: --minimum-version=3.10
match x:
case "abcd" | "abcd" | "abcd" :
pass
Expand Down
Original file line number Diff line number Diff line change
@@ -1,4 +1,4 @@
# flags: --preview --minimum-version=3.10
# flags: --minimum-version=3.10
match maybe, multiple:
case perhaps, 5:
pass
Expand Down
2 changes: 1 addition & 1 deletion tests/data/cases/pep604_union_types_line_breaks.py
Original file line number Diff line number Diff line change
@@ -1,4 +1,4 @@
# flags: --preview --minimum-version=3.10
# flags: --minimum-version=3.10
# This has always worked
z= Loooooooooooooooooooooooong | Loooooooooooooooooooooooong | Loooooooooooooooooooooooong | Loooooooooooooooooooooooong

Expand Down
Original file line number Diff line number Diff line change
@@ -1,4 +1,3 @@
# flags: --preview
x[(a:=0):]
x[:(a:=0)]

Expand Down
Original file line number Diff line number Diff line change
@@ -1,4 +1,3 @@
# flags: --preview
("" % a) ** 2
("" % a)[0]
("" % a)()
Expand Down Expand Up @@ -31,9 +30,9 @@
2 // ("" % a)
2 % ("" % a)
+("" % a)
b + "" % a
b + ("" % a)
-("" % a)
b - "" % a
b - ("" % a)
b + -("" % a)
~("" % a)
2 ** ("" % a)
Expand Down
Original file line number Diff line number Diff line change
@@ -1,4 +1,3 @@
# flags: --preview
a = 1**1**1**1**1**1**1**1**1**1**1**1**1**1**1**1**1**1**1**1**1**1**1**1**1**1**1**1
b = 1**1**1**1**1**1**1**1**1**1**1**1**1**1**1**1**1**1**1**1**1**1**1**1**1**1**1**1**1
c = 1 ** 1 ** 1 ** 1 ** 1 ** 1 ** 1 ** 1 ** 1 ** 1 ** 1 ** 1 ** 1 ** 1 ** 1 ** 1 ** 1 ** 1 ** 1 ** 1 ** 1 ** 1 ** 1 ** 1 ** 1 ** 1 ** 1 ** 1
Expand Down
Original file line number Diff line number Diff line change
@@ -1,4 +1,3 @@
# flags: --preview
first_item, second_item = (
some_looooooooong_module.some_looooooooooooooong_function_name(
first_argument, second_argument, third_argument
Expand Down
2 changes: 1 addition & 1 deletion tests/data/cases/py310_pep572.py
Original file line number Diff line number Diff line change
@@ -1,4 +1,4 @@
# flags: --preview --minimum-version=3.10
# flags: --minimum-version=3.10
x[a:=0]
x[a := 0]
x[a := 0, b := 1]
Expand Down
2 changes: 1 addition & 1 deletion tests/data/cases/raw_docstring.py
Original file line number Diff line number Diff line change
@@ -1,4 +1,4 @@
# flags: --preview --skip-string-normalization
# flags: --skip-string-normalization
class C:

r"""Raw"""
Expand Down
Original file line number Diff line number Diff line change
@@ -1,4 +1,4 @@
# flags: --preview --skip-string-normalization
# flags: --skip-string-normalization
def do_not_touch_this_prefix():
R"""There was a bug where docstring prefixes would be normalized even with -S."""

Expand Down
Original file line number Diff line number Diff line change
@@ -1,4 +1,3 @@
# flags: --preview
foo = 123 # fmt: skip # noqa: E501 # pylint
bar = (
123 ,
Expand Down
Original file line number Diff line number Diff line change
@@ -1,4 +1,3 @@
# flags: --preview
e = {
"a": fun(msg, "ts"),
"longggggggggggggggid": ...,
Expand Down
2 changes: 2 additions & 0 deletions tests/data/cases/walrus_in_dict.py
Original file line number Diff line number Diff line change
@@ -1,7 +1,9 @@
# flags: --preview
# This is testing an issue that is specific to the preview style
{
"is_update": (up := commit.hash in update_hashes)
}

# output
# This is testing an issue that is specific to the preview style
{"is_update": (up := commit.hash in update_hashes)}
Loading