Fix the input for black's line ranges test file (#9622)

This commit is contained in:
Micha Reiser 2024-01-23 11:40:23 +01:00 committed by GitHub
parent 47b8a897e7
commit 395bf3dc98
No known key found for this signature in database
GPG key ID: B5690EEEBB952194
19 changed files with 49 additions and 106 deletions

View file

@ -1,3 +1,4 @@
# flags: --line-ranges=5-6
# NOTE: If you need to modify this file, pay special attention to the --line-ranges=
# flag above as it's formatting specifically these lines.
def foo1(parameter_1, parameter_2, parameter_3, parameter_4, parameter_5, parameter_6, parameter_7): pass

View file

@ -1,3 +1,4 @@
# flags: --line-ranges=10-11
# NOTE: If you need to modify this file, pay special attention to the --line-ranges=
# flag above as it's formatting specifically these lines.

View file

@ -1,3 +1,4 @@
# flags: --line-ranges=7-7 --line-ranges=17-23
# NOTE: If you need to modify this file, pay special attention to the --line-ranges=
# flag above as it's formatting specifically these lines.

View file

@ -1,3 +1,4 @@
# flags: --line-ranges=12-12 --line-ranges=21-21
# NOTE: If you need to modify this file, pay special attention to the --line-ranges=
# flag above as it's formatting specifically these lines.

View file

@ -1,3 +1,4 @@
# flags: --line-ranges=11-17
# NOTE: If you need to modify this file, pay special attention to the --line-ranges=
# flag above as it's formatting specifically these lines.

View file

@ -1,3 +1,4 @@
# flags: --line-ranges=8-8
# NOTE: If you need to modify this file, pay special attention to the --line-ranges=
# flag above as it's formatting specifically these lines.

View file

@ -1,3 +1,4 @@
# flags: --line-ranges=8-8
# NOTE: If you need to modify this file, pay special attention to the --line-ranges=
# flag above as it's formatting specifically these lines.

View file

@ -1,3 +1,4 @@
# flags: --line-ranges=5-5
# NOTE: If you need to modify this file, pay special attention to the --line-ranges=
# flag above as it's formatting specifically these lines.
if cond1:

View file

@ -1,3 +1,4 @@
# flags: --line-ranges=9-11
# NOTE: If you need to modify this file, pay special attention to the --line-ranges=
# flag above as it's formatting specifically these lines.

View file

@ -1,3 +1,4 @@
# flags: --line-ranges=5-5 --line-ranges=9-9 --line-ranges=13-13
# NOTE: If you need to modify this file, pay special attention to the --line-ranges=
# flag above as it's formatting specifically these lines.
alist = [

View file

@ -45,6 +45,10 @@ def import_fixture(fixture: Path, fixture_set: str):
if "--pyi" in flags:
extension = "pyi"
if "--line-ranges=" in flags:
# Black preserves the flags for line-ranges tests to not mess up the line numbers
input.insert(0, flags)
if "--line-length=" in flags:
[_, length_and_rest] = flags.split("--line-length=", 1)
length = length_and_rest.split(" ", 1)[0]