mirror of
https://github.com/astral-sh/ruff.git
synced 2025-08-31 07:37:38 +00:00
Split implicit concatenated strings before binary expressions (#7145)
This commit is contained in:
parent
9671922e40
commit
e376c3ff7e
20 changed files with 1067 additions and 366 deletions
|
@ -313,3 +313,18 @@ expected_content = (
|
|||
self.base_url
|
||||
)
|
||||
)
|
||||
|
||||
|
||||
rowuses = [(1 << j) | # column ordinal
|
||||
(1 << (n + i-j + n-1)) | # NW-SE ordinal
|
||||
(1 << (n + 2*n-1 + i+j)) # NE-SW ordinal
|
||||
for j in rangen]
|
||||
|
||||
skip_bytes = (
|
||||
header.timecnt * 5 # Transition times and types
|
||||
+ header.typecnt * 6 # Local time type records
|
||||
+ header.charcnt # Time zone designations
|
||||
+ header.leapcnt * 8 # Leap second records
|
||||
+ header.isstdcnt # Standard/wall indicators
|
||||
+ header.isutcnt # UT/local indicators
|
||||
)
|
||||
|
|
|
@ -118,3 +118,45 @@ def test3():
|
|||
"(CASE WHEN JSON_TYPE(%s, %%s) IN (%s) "
|
||||
"THEN JSON_TYPE(%s, %%s) ELSE JSON_EXTRACT(%s, %%s) END)"
|
||||
) % (lhs, datatype_values, lhs, lhs), (tuple(params) + (json_path,)) * 3
|
||||
|
||||
c = (a +
|
||||
# test leading binary comment
|
||||
"a" "b" * b
|
||||
)
|
||||
|
||||
c = (a *
|
||||
# test leading comment
|
||||
"a" "b" + b
|
||||
)
|
||||
|
||||
c = (a
|
||||
+ # test trailing comment
|
||||
"a" "b" * b
|
||||
)
|
||||
|
||||
c = (a
|
||||
+
|
||||
"a" "b" # test trailing comment
|
||||
* b
|
||||
)
|
||||
|
||||
c = (a
|
||||
*
|
||||
"a" "b" # test trailing binary comment
|
||||
+ b
|
||||
)
|
||||
|
||||
c = (a
|
||||
*
|
||||
"a" "b"
|
||||
+ # test trailing operator comment
|
||||
b
|
||||
)
|
||||
|
||||
c = (a
|
||||
*
|
||||
"a" "b"
|
||||
+
|
||||
# test trailing operator comment
|
||||
b
|
||||
)
|
||||
|
|
Loading…
Add table
Add a link
Reference in a new issue