mirror of
https://github.com/astral-sh/ruff.git
synced 2025-11-03 13:14:34 +00:00
Allow simple container literals as default values (#3703)
This commit is contained in:
parent
0f95056f13
commit
7da06b9741
7 changed files with 552 additions and 253 deletions
|
|
@ -1,79 +1,161 @@
|
||||||
|
import math
|
||||||
|
import os
|
||||||
|
import sys
|
||||||
|
from math import inf
|
||||||
|
|
||||||
|
import numpy as np
|
||||||
|
|
||||||
def f12(
|
def f12(
|
||||||
x,
|
x,
|
||||||
y: str = os.pathsep, # OK
|
y: str = os.pathsep, # OK
|
||||||
) -> None:
|
) -> None: ...
|
||||||
...
|
def f11(*, x: str = "x") -> None: ... # OK
|
||||||
|
|
||||||
|
|
||||||
def f11(*, x: str = "x") -> None: # OK
|
|
||||||
...
|
|
||||||
|
|
||||||
|
|
||||||
def f13(
|
def f13(
|
||||||
x: list[str] = [
|
x: list[str] = [ # OK
|
||||||
"foo",
|
"foo",
|
||||||
"bar",
|
"bar",
|
||||||
"baz",
|
"baz",
|
||||||
] # OK
|
]
|
||||||
) -> None:
|
) -> None: ...
|
||||||
...
|
|
||||||
|
|
||||||
|
|
||||||
def f14(
|
def f14(
|
||||||
x: tuple[str, ...] = (
|
x: tuple[str, ...] = ( # OK
|
||||||
"foo",
|
"foo",
|
||||||
"bar",
|
"bar",
|
||||||
"baz",
|
"baz",
|
||||||
) # OK
|
)
|
||||||
) -> None:
|
) -> None: ...
|
||||||
...
|
|
||||||
|
|
||||||
|
|
||||||
def f15(
|
def f15(
|
||||||
x: set[str] = {
|
x: set[str] = { # OK
|
||||||
"foo",
|
"foo",
|
||||||
"bar",
|
"bar",
|
||||||
"baz",
|
"baz",
|
||||||
} # OK
|
}
|
||||||
) -> None:
|
) -> None: ...
|
||||||
...
|
def f151(x: dict[int, int] = {1: 2}) -> None: ... # Ok
|
||||||
|
def f152(
|
||||||
|
x: dict[
|
||||||
def f16(x: frozenset[bytes] = frozenset({b"foo", b"bar", b"baz"})) -> None: # OK
|
int, int
|
||||||
...
|
] = { # OK
|
||||||
|
1: 2,
|
||||||
|
**{3: 4},
|
||||||
|
}
|
||||||
|
) -> None: ...
|
||||||
|
def f153(
|
||||||
|
x: list[
|
||||||
|
int
|
||||||
|
] = [ # OK
|
||||||
|
1,
|
||||||
|
2,
|
||||||
|
3,
|
||||||
|
4,
|
||||||
|
5,
|
||||||
|
6,
|
||||||
|
7,
|
||||||
|
8,
|
||||||
|
9,
|
||||||
|
10,
|
||||||
|
11,
|
||||||
|
]
|
||||||
|
) -> None: ...
|
||||||
|
def f154(
|
||||||
|
x: tuple[
|
||||||
|
str, tuple[str, ...]
|
||||||
|
] = ( # OK
|
||||||
|
"foo",
|
||||||
|
("bar", "baz"),
|
||||||
|
)
|
||||||
|
) -> None: ...
|
||||||
|
def f141(
|
||||||
|
x: list[
|
||||||
|
int
|
||||||
|
] = [ # OK
|
||||||
|
*range(10)
|
||||||
|
],
|
||||||
|
) -> None: ...
|
||||||
|
def f142(
|
||||||
|
x: list[
|
||||||
|
int
|
||||||
|
] = list( # OK
|
||||||
|
range(10)
|
||||||
|
),
|
||||||
|
) -> None: ...
|
||||||
|
def f16(
|
||||||
|
x: frozenset[
|
||||||
|
bytes
|
||||||
|
] = frozenset( # OK
|
||||||
|
{b"foo", b"bar", b"baz"}
|
||||||
|
)
|
||||||
|
) -> None: ...
|
||||||
def f17(
|
def f17(
|
||||||
x: str = "foo" + "bar", # OK
|
x: str = "foo" # OK
|
||||||
) -> None:
|
+ "bar",
|
||||||
...
|
) -> None: ...
|
||||||
|
|
||||||
|
|
||||||
def f18(
|
def f18(
|
||||||
x: str = b"foo" + b"bar", # OK
|
x: str = b"foo" # OK
|
||||||
) -> None:
|
+ b"bar",
|
||||||
...
|
) -> None: ...
|
||||||
|
|
||||||
|
|
||||||
def f19(
|
def f19(
|
||||||
x: object = "foo" + 4, # OK
|
x: object = "foo" # OK
|
||||||
) -> None:
|
+ 4,
|
||||||
...
|
) -> None: ...
|
||||||
|
|
||||||
|
|
||||||
def f20(
|
def f20(
|
||||||
x: int = 5 + 5, # OK
|
x: int = 5
|
||||||
) -> None:
|
+ 5, # OK
|
||||||
...
|
) -> None: ...
|
||||||
|
|
||||||
|
|
||||||
def f21(
|
def f21(
|
||||||
x: complex = 3j - 3j, # OK
|
x: complex = 3j
|
||||||
) -> None:
|
- 3j, # OK
|
||||||
...
|
) -> None: ...
|
||||||
|
|
||||||
|
|
||||||
def f22(
|
def f22(
|
||||||
x: complex = -42.5j + 4.3j, # OK
|
x: complex = -42.5j # OK
|
||||||
) -> None:
|
+ 4.3j,
|
||||||
...
|
) -> None: ...
|
||||||
|
def f23(
|
||||||
|
x: bool = True, # OK
|
||||||
|
) -> None: ...
|
||||||
|
def f24(
|
||||||
|
x: float = 3.14, # OK
|
||||||
|
) -> None: ...
|
||||||
|
def f25(
|
||||||
|
x: float = -3.14, # OK
|
||||||
|
) -> None: ...
|
||||||
|
def f26(
|
||||||
|
x: complex = -3.14j, # OK
|
||||||
|
) -> None: ...
|
||||||
|
def f27(
|
||||||
|
x: complex = -3 - 3.14j, # OK
|
||||||
|
) -> None: ...
|
||||||
|
def f28(
|
||||||
|
x: float = math.tau, # OK
|
||||||
|
) -> None: ...
|
||||||
|
def f29(
|
||||||
|
x: float = math.inf, # OK
|
||||||
|
) -> None: ...
|
||||||
|
def f30(
|
||||||
|
x: float = -math.inf, # OK
|
||||||
|
) -> None: ...
|
||||||
|
def f31(
|
||||||
|
x: float = inf, # OK
|
||||||
|
) -> None: ...
|
||||||
|
def f32(
|
||||||
|
x: float = np.inf, # OK
|
||||||
|
) -> None: ...
|
||||||
|
def f33(
|
||||||
|
x: float = math.nan, # OK
|
||||||
|
) -> None: ...
|
||||||
|
def f34(
|
||||||
|
x: float = -math.nan, # OK
|
||||||
|
) -> None: ...
|
||||||
|
def f35(
|
||||||
|
x: complex = math.inf # OK
|
||||||
|
+ 1j,
|
||||||
|
) -> None: ...
|
||||||
|
def f36(
|
||||||
|
*,
|
||||||
|
x: str = sys.version, # OK
|
||||||
|
) -> None: ...
|
||||||
|
def f37(
|
||||||
|
*,
|
||||||
|
x: str = "" # OK
|
||||||
|
+ "",
|
||||||
|
) -> None: ...
|
||||||
|
|
|
||||||
|
|
@ -11,32 +11,74 @@ def f12(
|
||||||
) -> None: ...
|
) -> None: ...
|
||||||
def f11(*, x: str = "x") -> None: ... # OK
|
def f11(*, x: str = "x") -> None: ... # OK
|
||||||
def f13(
|
def f13(
|
||||||
x: list[
|
x: list[str] = [ # OK
|
||||||
str
|
|
||||||
] = [ # Error PYI011 Only simple default values allowed for typed arguments
|
|
||||||
"foo",
|
"foo",
|
||||||
"bar",
|
"bar",
|
||||||
"baz",
|
"baz",
|
||||||
]
|
]
|
||||||
) -> None: ...
|
) -> None: ...
|
||||||
def f14(
|
def f14(
|
||||||
x: tuple[
|
x: tuple[str, ...] = ( # OK
|
||||||
str, ...
|
|
||||||
] = ( # Error PYI011 Only simple default values allowed for typed arguments
|
|
||||||
"foo",
|
"foo",
|
||||||
"bar",
|
"bar",
|
||||||
"baz",
|
"baz",
|
||||||
)
|
)
|
||||||
) -> None: ...
|
) -> None: ...
|
||||||
def f15(
|
def f15(
|
||||||
x: set[
|
x: set[str] = { # OK
|
||||||
str
|
|
||||||
] = { # Error PYI011 Only simple default values allowed for typed arguments
|
|
||||||
"foo",
|
"foo",
|
||||||
"bar",
|
"bar",
|
||||||
"baz",
|
"baz",
|
||||||
}
|
}
|
||||||
) -> None: ...
|
) -> None: ...
|
||||||
|
def f151(x: dict[int, int] = {1: 2}) -> None: ... # Ok
|
||||||
|
def f152(
|
||||||
|
x: dict[
|
||||||
|
int, int
|
||||||
|
] = { # Error PYI011 Only simple default values allowed for typed arguments
|
||||||
|
1: 2,
|
||||||
|
**{3: 4},
|
||||||
|
}
|
||||||
|
) -> None: ...
|
||||||
|
def f153(
|
||||||
|
x: list[
|
||||||
|
int
|
||||||
|
] = [ # Error PYI011 Only simple default values allowed for typed arguments
|
||||||
|
1,
|
||||||
|
2,
|
||||||
|
3,
|
||||||
|
4,
|
||||||
|
5,
|
||||||
|
6,
|
||||||
|
7,
|
||||||
|
8,
|
||||||
|
9,
|
||||||
|
10,
|
||||||
|
11,
|
||||||
|
]
|
||||||
|
) -> None: ...
|
||||||
|
def f154(
|
||||||
|
x: tuple[
|
||||||
|
str, tuple[str, ...]
|
||||||
|
] = ( # Error PYI011 Only simple default values allowed for typed arguments
|
||||||
|
"foo",
|
||||||
|
("bar", "baz"),
|
||||||
|
)
|
||||||
|
) -> None: ...
|
||||||
|
def f141(
|
||||||
|
x: list[
|
||||||
|
int
|
||||||
|
] = [ # Error PYI011 Only simple default values allowed for typed arguments
|
||||||
|
*range(10)
|
||||||
|
],
|
||||||
|
) -> None: ...
|
||||||
|
def f142(
|
||||||
|
x: list[
|
||||||
|
int
|
||||||
|
] = list( # Error PYI011 Only simple default values allowed for typed arguments
|
||||||
|
range(10)
|
||||||
|
),
|
||||||
|
) -> None: ...
|
||||||
def f16(
|
def f16(
|
||||||
x: frozenset[
|
x: frozenset[
|
||||||
bytes
|
bytes
|
||||||
|
|
@ -109,8 +151,11 @@ def f35(
|
||||||
+ 1j,
|
+ 1j,
|
||||||
) -> None: ...
|
) -> None: ...
|
||||||
def f36(
|
def f36(
|
||||||
*, x: str = sys.version, # OK
|
*,
|
||||||
|
x: str = sys.version, # OK
|
||||||
) -> None: ...
|
) -> None: ...
|
||||||
def f37(
|
def f37(
|
||||||
*, x: str = "" + "", # Error PYI011 Only simple default values allowed for typed arguments
|
*,
|
||||||
|
x: str = "" # Error PYI011 Only simple default values allowed for typed arguments
|
||||||
|
+ "",
|
||||||
) -> None: ...
|
) -> None: ...
|
||||||
|
|
|
||||||
|
|
@ -39,6 +39,58 @@ def f15(
|
||||||
...
|
...
|
||||||
|
|
||||||
|
|
||||||
|
def f151(x={1: 2}) -> None: # Ok
|
||||||
|
...
|
||||||
|
|
||||||
|
|
||||||
|
def f152(
|
||||||
|
x={ # OK
|
||||||
|
1: 2,
|
||||||
|
**{3: 4},
|
||||||
|
}
|
||||||
|
) -> None:
|
||||||
|
...
|
||||||
|
|
||||||
|
|
||||||
|
def f153(
|
||||||
|
x=[ # OK
|
||||||
|
1,
|
||||||
|
2,
|
||||||
|
3,
|
||||||
|
4,
|
||||||
|
5,
|
||||||
|
6,
|
||||||
|
7,
|
||||||
|
8,
|
||||||
|
9,
|
||||||
|
10,
|
||||||
|
11,
|
||||||
|
]
|
||||||
|
) -> None:
|
||||||
|
...
|
||||||
|
|
||||||
|
|
||||||
|
def f154(
|
||||||
|
x=( # OK
|
||||||
|
"foo",
|
||||||
|
("bar", "baz"),
|
||||||
|
)
|
||||||
|
) -> None:
|
||||||
|
...
|
||||||
|
|
||||||
|
|
||||||
|
def f141(
|
||||||
|
x=[*range(10)], # OK
|
||||||
|
) -> None:
|
||||||
|
...
|
||||||
|
|
||||||
|
|
||||||
|
def f142(
|
||||||
|
x=list(range(10)), # OK
|
||||||
|
) -> None:
|
||||||
|
...
|
||||||
|
|
||||||
|
|
||||||
def f16(x=frozenset({b"foo", b"bar", b"baz"})) -> None:
|
def f16(x=frozenset({b"foo", b"bar", b"baz"})) -> None:
|
||||||
... # OK
|
... # OK
|
||||||
|
|
||||||
|
|
|
||||||
|
|
@ -4,26 +4,60 @@ def f12(
|
||||||
) -> None: ...
|
) -> None: ...
|
||||||
def f11(*, x="x") -> None: ... # OK
|
def f11(*, x="x") -> None: ... # OK
|
||||||
def f13(
|
def f13(
|
||||||
x=[ # Error PYI014
|
x=[ # OK
|
||||||
"foo",
|
"foo",
|
||||||
"bar",
|
"bar",
|
||||||
"baz",
|
"baz",
|
||||||
]
|
]
|
||||||
) -> None: ...
|
) -> None: ...
|
||||||
def f14(
|
def f14(
|
||||||
x=( # Error PYI014
|
x=( # OK
|
||||||
"foo",
|
"foo",
|
||||||
"bar",
|
"bar",
|
||||||
"baz",
|
"baz",
|
||||||
)
|
)
|
||||||
) -> None: ...
|
) -> None: ...
|
||||||
def f15(
|
def f15(
|
||||||
x={ # Error PYI014
|
x={ # OK
|
||||||
"foo",
|
"foo",
|
||||||
"bar",
|
"bar",
|
||||||
"baz",
|
"baz",
|
||||||
}
|
}
|
||||||
) -> None: ...
|
) -> None: ...
|
||||||
|
def f151(x={1: 2}) -> None: ...
|
||||||
|
def f152(
|
||||||
|
x={ # Error PYI014
|
||||||
|
1: 2,
|
||||||
|
**{3: 4},
|
||||||
|
}
|
||||||
|
) -> None: ...
|
||||||
|
def f153(
|
||||||
|
x=[ # Error PYI014
|
||||||
|
1,
|
||||||
|
2,
|
||||||
|
3,
|
||||||
|
4,
|
||||||
|
5,
|
||||||
|
6,
|
||||||
|
7,
|
||||||
|
8,
|
||||||
|
9,
|
||||||
|
10,
|
||||||
|
11,
|
||||||
|
]
|
||||||
|
) -> None: ...
|
||||||
|
def f154(
|
||||||
|
x=( # Error PYI014
|
||||||
|
"foo",
|
||||||
|
("bar", "baz"),
|
||||||
|
)
|
||||||
|
) -> None: ...
|
||||||
|
def f141(
|
||||||
|
x=[*range(10)], # Error PYI014
|
||||||
|
) -> None: ...
|
||||||
|
def f142(
|
||||||
|
x=list(range(10)), # Error PYI014
|
||||||
|
) -> None: ...
|
||||||
def f16(x=frozenset({b"foo", b"bar", b"baz"})) -> None: ... # Error PYI014
|
def f16(x=frozenset({b"foo", b"bar", b"baz"})) -> None: ... # Error PYI014
|
||||||
def f17(
|
def f17(
|
||||||
x="foo" + "bar", # Error PYI014
|
x="foo" + "bar", # Error PYI014
|
||||||
|
|
|
||||||
|
|
@ -58,8 +58,28 @@ const ALLOWED_ATTRIBUTES_IN_DEFAULTS: &[&[&str]] = &[
|
||||||
&["sys", "winver"],
|
&["sys", "winver"],
|
||||||
];
|
];
|
||||||
|
|
||||||
fn is_valid_default_value_with_annotation(default: &Expr, checker: &Checker) -> bool {
|
fn is_valid_default_value_with_annotation(
|
||||||
|
default: &Expr,
|
||||||
|
checker: &Checker,
|
||||||
|
allow_container: bool,
|
||||||
|
) -> bool {
|
||||||
match &default.node {
|
match &default.node {
|
||||||
|
ExprKind::List { elts, .. } | ExprKind::Tuple { elts, .. } | ExprKind::Set { elts, .. } => {
|
||||||
|
return allow_container
|
||||||
|
&& elts.len() <= 10
|
||||||
|
&& elts
|
||||||
|
.iter()
|
||||||
|
.all(|e| is_valid_default_value_with_annotation(e, checker, false));
|
||||||
|
}
|
||||||
|
ExprKind::Dict { keys, values, .. } => {
|
||||||
|
return allow_container
|
||||||
|
&& keys.len() <= 10
|
||||||
|
&& keys.iter().zip(values).all(|(k, v)| {
|
||||||
|
k.as_ref().map_or(false, |k| {
|
||||||
|
is_valid_default_value_with_annotation(k, checker, false)
|
||||||
|
}) && is_valid_default_value_with_annotation(v, checker, false)
|
||||||
|
});
|
||||||
|
}
|
||||||
ExprKind::Constant {
|
ExprKind::Constant {
|
||||||
value: Constant::Ellipsis | Constant::None,
|
value: Constant::Ellipsis | Constant::None,
|
||||||
..
|
..
|
||||||
|
|
@ -192,7 +212,7 @@ pub fn typed_argument_simple_defaults(checker: &mut Checker, args: &Arguments) {
|
||||||
.and_then(|i| args.defaults.get(i))
|
.and_then(|i| args.defaults.get(i))
|
||||||
{
|
{
|
||||||
if arg.node.annotation.is_some() {
|
if arg.node.annotation.is_some() {
|
||||||
if !is_valid_default_value_with_annotation(default, checker) {
|
if !is_valid_default_value_with_annotation(default, checker, true) {
|
||||||
let mut diagnostic =
|
let mut diagnostic =
|
||||||
Diagnostic::new(TypedArgumentDefaultInStub, Range::from(default));
|
Diagnostic::new(TypedArgumentDefaultInStub, Range::from(default));
|
||||||
|
|
||||||
|
|
@ -219,7 +239,7 @@ pub fn typed_argument_simple_defaults(checker: &mut Checker, args: &Arguments) {
|
||||||
.and_then(|i| args.kw_defaults.get(i))
|
.and_then(|i| args.kw_defaults.get(i))
|
||||||
{
|
{
|
||||||
if kwarg.node.annotation.is_some() {
|
if kwarg.node.annotation.is_some() {
|
||||||
if !is_valid_default_value_with_annotation(default, checker) {
|
if !is_valid_default_value_with_annotation(default, checker, true) {
|
||||||
let mut diagnostic =
|
let mut diagnostic =
|
||||||
Diagnostic::new(TypedArgumentDefaultInStub, Range::from(default));
|
Diagnostic::new(TypedArgumentDefaultInStub, Range::from(default));
|
||||||
|
|
||||||
|
|
@ -249,7 +269,7 @@ pub fn argument_simple_defaults(checker: &mut Checker, args: &Arguments) {
|
||||||
.and_then(|i| args.defaults.get(i))
|
.and_then(|i| args.defaults.get(i))
|
||||||
{
|
{
|
||||||
if arg.node.annotation.is_none() {
|
if arg.node.annotation.is_none() {
|
||||||
if !is_valid_default_value_with_annotation(default, checker) {
|
if !is_valid_default_value_with_annotation(default, checker, true) {
|
||||||
checker
|
checker
|
||||||
.diagnostics
|
.diagnostics
|
||||||
.push(Diagnostic::new(ArgumentDefaultInStub, Range::from(default)));
|
.push(Diagnostic::new(ArgumentDefaultInStub, Range::from(default)));
|
||||||
|
|
@ -267,7 +287,7 @@ pub fn argument_simple_defaults(checker: &mut Checker, args: &Arguments) {
|
||||||
.and_then(|i| args.kw_defaults.get(i))
|
.and_then(|i| args.kw_defaults.get(i))
|
||||||
{
|
{
|
||||||
if kwarg.node.annotation.is_none() {
|
if kwarg.node.annotation.is_none() {
|
||||||
if !is_valid_default_value_with_annotation(default, checker) {
|
if !is_valid_default_value_with_annotation(default, checker, true) {
|
||||||
checker
|
checker
|
||||||
.diagnostics
|
.diagnostics
|
||||||
.push(Diagnostic::new(ArgumentDefaultInStub, Range::from(default)));
|
.push(Diagnostic::new(ArgumentDefaultInStub, Range::from(default)));
|
||||||
|
|
|
||||||
|
|
@ -28,58 +28,18 @@ expression: diagnostics
|
||||||
suggestion: "Replace default value by `...`"
|
suggestion: "Replace default value by `...`"
|
||||||
fixable: true
|
fixable: true
|
||||||
location:
|
location:
|
||||||
row: 16
|
|
||||||
column: 8
|
|
||||||
end_location:
|
|
||||||
row: 20
|
|
||||||
column: 5
|
|
||||||
fix:
|
|
||||||
content: "..."
|
|
||||||
location:
|
|
||||||
row: 16
|
|
||||||
column: 8
|
|
||||||
end_location:
|
|
||||||
row: 20
|
|
||||||
column: 5
|
|
||||||
parent: ~
|
|
||||||
- kind:
|
|
||||||
name: TypedArgumentDefaultInStub
|
|
||||||
body: Only simple default values allowed for typed arguments
|
|
||||||
suggestion: "Replace default value by `...`"
|
|
||||||
fixable: true
|
|
||||||
location:
|
|
||||||
row: 25
|
|
||||||
column: 8
|
|
||||||
end_location:
|
|
||||||
row: 29
|
|
||||||
column: 5
|
|
||||||
fix:
|
|
||||||
content: "..."
|
|
||||||
location:
|
|
||||||
row: 25
|
|
||||||
column: 8
|
|
||||||
end_location:
|
|
||||||
row: 29
|
|
||||||
column: 5
|
|
||||||
parent: ~
|
|
||||||
- kind:
|
|
||||||
name: TypedArgumentDefaultInStub
|
|
||||||
body: Only simple default values allowed for typed arguments
|
|
||||||
suggestion: "Replace default value by `...`"
|
|
||||||
fixable: true
|
|
||||||
location:
|
|
||||||
row: 34
|
|
||||||
column: 8
|
|
||||||
end_location:
|
|
||||||
row: 38
|
row: 38
|
||||||
|
column: 8
|
||||||
|
end_location:
|
||||||
|
row: 41
|
||||||
column: 5
|
column: 5
|
||||||
fix:
|
fix:
|
||||||
content: "..."
|
content: "..."
|
||||||
location:
|
location:
|
||||||
row: 34
|
|
||||||
column: 8
|
|
||||||
end_location:
|
|
||||||
row: 38
|
row: 38
|
||||||
|
column: 8
|
||||||
|
end_location:
|
||||||
|
row: 41
|
||||||
column: 5
|
column: 5
|
||||||
parent: ~
|
parent: ~
|
||||||
- kind:
|
- kind:
|
||||||
|
|
@ -88,18 +48,18 @@ expression: diagnostics
|
||||||
suggestion: "Replace default value by `...`"
|
suggestion: "Replace default value by `...`"
|
||||||
fixable: true
|
fixable: true
|
||||||
location:
|
location:
|
||||||
row: 43
|
row: 46
|
||||||
column: 8
|
column: 8
|
||||||
end_location:
|
end_location:
|
||||||
row: 45
|
row: 58
|
||||||
column: 5
|
column: 5
|
||||||
fix:
|
fix:
|
||||||
content: "..."
|
content: "..."
|
||||||
location:
|
location:
|
||||||
row: 43
|
row: 46
|
||||||
column: 8
|
column: 8
|
||||||
end_location:
|
end_location:
|
||||||
row: 45
|
row: 58
|
||||||
column: 5
|
column: 5
|
||||||
parent: ~
|
parent: ~
|
||||||
- kind:
|
- kind:
|
||||||
|
|
@ -108,18 +68,98 @@ expression: diagnostics
|
||||||
suggestion: "Replace default value by `...`"
|
suggestion: "Replace default value by `...`"
|
||||||
fixable: true
|
fixable: true
|
||||||
location:
|
location:
|
||||||
row: 48
|
row: 63
|
||||||
|
column: 8
|
||||||
|
end_location:
|
||||||
|
row: 66
|
||||||
|
column: 5
|
||||||
|
fix:
|
||||||
|
content: "..."
|
||||||
|
location:
|
||||||
|
row: 63
|
||||||
|
column: 8
|
||||||
|
end_location:
|
||||||
|
row: 66
|
||||||
|
column: 5
|
||||||
|
parent: ~
|
||||||
|
- kind:
|
||||||
|
name: TypedArgumentDefaultInStub
|
||||||
|
body: Only simple default values allowed for typed arguments
|
||||||
|
suggestion: "Replace default value by `...`"
|
||||||
|
fixable: true
|
||||||
|
location:
|
||||||
|
row: 71
|
||||||
|
column: 8
|
||||||
|
end_location:
|
||||||
|
row: 73
|
||||||
|
column: 5
|
||||||
|
fix:
|
||||||
|
content: "..."
|
||||||
|
location:
|
||||||
|
row: 71
|
||||||
|
column: 8
|
||||||
|
end_location:
|
||||||
|
row: 73
|
||||||
|
column: 5
|
||||||
|
parent: ~
|
||||||
|
- kind:
|
||||||
|
name: TypedArgumentDefaultInStub
|
||||||
|
body: Only simple default values allowed for typed arguments
|
||||||
|
suggestion: "Replace default value by `...`"
|
||||||
|
fixable: true
|
||||||
|
location:
|
||||||
|
row: 78
|
||||||
|
column: 8
|
||||||
|
end_location:
|
||||||
|
row: 80
|
||||||
|
column: 5
|
||||||
|
fix:
|
||||||
|
content: "..."
|
||||||
|
location:
|
||||||
|
row: 78
|
||||||
|
column: 8
|
||||||
|
end_location:
|
||||||
|
row: 80
|
||||||
|
column: 5
|
||||||
|
parent: ~
|
||||||
|
- kind:
|
||||||
|
name: TypedArgumentDefaultInStub
|
||||||
|
body: Only simple default values allowed for typed arguments
|
||||||
|
suggestion: "Replace default value by `...`"
|
||||||
|
fixable: true
|
||||||
|
location:
|
||||||
|
row: 85
|
||||||
|
column: 8
|
||||||
|
end_location:
|
||||||
|
row: 87
|
||||||
|
column: 5
|
||||||
|
fix:
|
||||||
|
content: "..."
|
||||||
|
location:
|
||||||
|
row: 85
|
||||||
|
column: 8
|
||||||
|
end_location:
|
||||||
|
row: 87
|
||||||
|
column: 5
|
||||||
|
parent: ~
|
||||||
|
- kind:
|
||||||
|
name: TypedArgumentDefaultInStub
|
||||||
|
body: Only simple default values allowed for typed arguments
|
||||||
|
suggestion: "Replace default value by `...`"
|
||||||
|
fixable: true
|
||||||
|
location:
|
||||||
|
row: 90
|
||||||
column: 13
|
column: 13
|
||||||
end_location:
|
end_location:
|
||||||
row: 49
|
row: 91
|
||||||
column: 11
|
column: 11
|
||||||
fix:
|
fix:
|
||||||
content: "..."
|
content: "..."
|
||||||
location:
|
location:
|
||||||
row: 48
|
row: 90
|
||||||
column: 13
|
column: 13
|
||||||
end_location:
|
end_location:
|
||||||
row: 49
|
row: 91
|
||||||
column: 11
|
column: 11
|
||||||
parent: ~
|
parent: ~
|
||||||
- kind:
|
- kind:
|
||||||
|
|
@ -128,18 +168,18 @@ expression: diagnostics
|
||||||
suggestion: "Replace default value by `...`"
|
suggestion: "Replace default value by `...`"
|
||||||
fixable: true
|
fixable: true
|
||||||
location:
|
location:
|
||||||
row: 52
|
row: 94
|
||||||
column: 13
|
column: 13
|
||||||
end_location:
|
end_location:
|
||||||
row: 53
|
row: 95
|
||||||
column: 12
|
column: 12
|
||||||
fix:
|
fix:
|
||||||
content: "..."
|
content: "..."
|
||||||
location:
|
location:
|
||||||
row: 52
|
row: 94
|
||||||
column: 13
|
column: 13
|
||||||
end_location:
|
end_location:
|
||||||
row: 53
|
row: 95
|
||||||
column: 12
|
column: 12
|
||||||
parent: ~
|
parent: ~
|
||||||
- kind:
|
- kind:
|
||||||
|
|
@ -148,18 +188,18 @@ expression: diagnostics
|
||||||
suggestion: "Replace default value by `...`"
|
suggestion: "Replace default value by `...`"
|
||||||
fixable: true
|
fixable: true
|
||||||
location:
|
location:
|
||||||
row: 56
|
row: 98
|
||||||
column: 16
|
column: 16
|
||||||
end_location:
|
end_location:
|
||||||
row: 57
|
row: 99
|
||||||
column: 7
|
column: 7
|
||||||
fix:
|
fix:
|
||||||
content: "..."
|
content: "..."
|
||||||
location:
|
location:
|
||||||
row: 56
|
row: 98
|
||||||
column: 16
|
column: 16
|
||||||
end_location:
|
end_location:
|
||||||
row: 57
|
row: 99
|
||||||
column: 7
|
column: 7
|
||||||
parent: ~
|
parent: ~
|
||||||
- kind:
|
- kind:
|
||||||
|
|
@ -168,18 +208,18 @@ expression: diagnostics
|
||||||
suggestion: "Replace default value by `...`"
|
suggestion: "Replace default value by `...`"
|
||||||
fixable: true
|
fixable: true
|
||||||
location:
|
location:
|
||||||
row: 60
|
row: 102
|
||||||
column: 13
|
column: 13
|
||||||
end_location:
|
end_location:
|
||||||
row: 61
|
row: 103
|
||||||
column: 7
|
column: 7
|
||||||
fix:
|
fix:
|
||||||
content: "..."
|
content: "..."
|
||||||
location:
|
location:
|
||||||
row: 60
|
row: 102
|
||||||
column: 13
|
column: 13
|
||||||
end_location:
|
end_location:
|
||||||
row: 61
|
row: 103
|
||||||
column: 7
|
column: 7
|
||||||
parent: ~
|
parent: ~
|
||||||
- kind:
|
- kind:
|
||||||
|
|
@ -188,18 +228,18 @@ expression: diagnostics
|
||||||
suggestion: "Replace default value by `...`"
|
suggestion: "Replace default value by `...`"
|
||||||
fixable: true
|
fixable: true
|
||||||
location:
|
location:
|
||||||
row: 64
|
row: 106
|
||||||
column: 17
|
column: 17
|
||||||
end_location:
|
end_location:
|
||||||
row: 65
|
row: 107
|
||||||
column: 8
|
column: 8
|
||||||
fix:
|
fix:
|
||||||
content: "..."
|
content: "..."
|
||||||
location:
|
location:
|
||||||
row: 64
|
row: 106
|
||||||
column: 17
|
column: 17
|
||||||
end_location:
|
end_location:
|
||||||
row: 65
|
row: 107
|
||||||
column: 8
|
column: 8
|
||||||
parent: ~
|
parent: ~
|
||||||
- kind:
|
- kind:
|
||||||
|
|
@ -208,18 +248,18 @@ expression: diagnostics
|
||||||
suggestion: "Replace default value by `...`"
|
suggestion: "Replace default value by `...`"
|
||||||
fixable: true
|
fixable: true
|
||||||
location:
|
location:
|
||||||
row: 68
|
row: 110
|
||||||
column: 17
|
column: 17
|
||||||
end_location:
|
end_location:
|
||||||
row: 69
|
row: 111
|
||||||
column: 10
|
column: 10
|
||||||
fix:
|
fix:
|
||||||
content: "..."
|
content: "..."
|
||||||
location:
|
location:
|
||||||
row: 68
|
row: 110
|
||||||
column: 17
|
column: 17
|
||||||
end_location:
|
end_location:
|
||||||
row: 69
|
row: 111
|
||||||
column: 10
|
column: 10
|
||||||
parent: ~
|
parent: ~
|
||||||
- kind:
|
- kind:
|
||||||
|
|
@ -228,18 +268,18 @@ expression: diagnostics
|
||||||
suggestion: "Replace default value by `...`"
|
suggestion: "Replace default value by `...`"
|
||||||
fixable: true
|
fixable: true
|
||||||
location:
|
location:
|
||||||
row: 96
|
row: 138
|
||||||
column: 15
|
column: 15
|
||||||
end_location:
|
end_location:
|
||||||
row: 96
|
row: 138
|
||||||
column: 18
|
column: 18
|
||||||
fix:
|
fix:
|
||||||
content: "..."
|
content: "..."
|
||||||
location:
|
location:
|
||||||
row: 96
|
row: 138
|
||||||
column: 15
|
column: 15
|
||||||
end_location:
|
end_location:
|
||||||
row: 96
|
row: 138
|
||||||
column: 18
|
column: 18
|
||||||
parent: ~
|
parent: ~
|
||||||
- kind:
|
- kind:
|
||||||
|
|
@ -248,18 +288,18 @@ expression: diagnostics
|
||||||
suggestion: "Replace default value by `...`"
|
suggestion: "Replace default value by `...`"
|
||||||
fixable: true
|
fixable: true
|
||||||
location:
|
location:
|
||||||
row: 99
|
row: 141
|
||||||
column: 15
|
column: 15
|
||||||
end_location:
|
end_location:
|
||||||
row: 99
|
row: 141
|
||||||
column: 21
|
column: 21
|
||||||
fix:
|
fix:
|
||||||
content: "..."
|
content: "..."
|
||||||
location:
|
location:
|
||||||
row: 99
|
row: 141
|
||||||
column: 15
|
column: 15
|
||||||
end_location:
|
end_location:
|
||||||
row: 99
|
row: 141
|
||||||
column: 21
|
column: 21
|
||||||
parent: ~
|
parent: ~
|
||||||
- kind:
|
- kind:
|
||||||
|
|
@ -268,18 +308,18 @@ expression: diagnostics
|
||||||
suggestion: "Replace default value by `...`"
|
suggestion: "Replace default value by `...`"
|
||||||
fixable: true
|
fixable: true
|
||||||
location:
|
location:
|
||||||
row: 105
|
row: 147
|
||||||
column: 15
|
column: 15
|
||||||
end_location:
|
end_location:
|
||||||
row: 105
|
row: 147
|
||||||
column: 24
|
column: 24
|
||||||
fix:
|
fix:
|
||||||
content: "..."
|
content: "..."
|
||||||
location:
|
location:
|
||||||
row: 105
|
row: 147
|
||||||
column: 15
|
column: 15
|
||||||
end_location:
|
end_location:
|
||||||
row: 105
|
row: 147
|
||||||
column: 24
|
column: 24
|
||||||
parent: ~
|
parent: ~
|
||||||
- kind:
|
- kind:
|
||||||
|
|
@ -288,18 +328,18 @@ expression: diagnostics
|
||||||
suggestion: "Replace default value by `...`"
|
suggestion: "Replace default value by `...`"
|
||||||
fixable: true
|
fixable: true
|
||||||
location:
|
location:
|
||||||
row: 108
|
row: 150
|
||||||
column: 17
|
column: 17
|
||||||
end_location:
|
end_location:
|
||||||
row: 109
|
row: 151
|
||||||
column: 8
|
column: 8
|
||||||
fix:
|
fix:
|
||||||
content: "..."
|
content: "..."
|
||||||
location:
|
location:
|
||||||
row: 108
|
row: 150
|
||||||
column: 17
|
column: 17
|
||||||
end_location:
|
end_location:
|
||||||
row: 109
|
row: 151
|
||||||
column: 8
|
column: 8
|
||||||
parent: ~
|
parent: ~
|
||||||
- kind:
|
- kind:
|
||||||
|
|
@ -308,18 +348,18 @@ expression: diagnostics
|
||||||
suggestion: "Replace default value by `...`"
|
suggestion: "Replace default value by `...`"
|
||||||
fixable: true
|
fixable: true
|
||||||
location:
|
location:
|
||||||
row: 115
|
row: 159
|
||||||
column: 16
|
column: 13
|
||||||
end_location:
|
end_location:
|
||||||
row: 115
|
row: 160
|
||||||
column: 23
|
column: 8
|
||||||
fix:
|
fix:
|
||||||
content: "..."
|
content: "..."
|
||||||
location:
|
location:
|
||||||
row: 115
|
row: 159
|
||||||
column: 16
|
column: 13
|
||||||
end_location:
|
end_location:
|
||||||
row: 115
|
row: 160
|
||||||
column: 23
|
column: 8
|
||||||
parent: ~
|
parent: ~
|
||||||
|
|
||||||
|
|
|
||||||
|
|
@ -15,58 +15,6 @@ expression: diagnostics
|
||||||
column: 16
|
column: 16
|
||||||
fix: ~
|
fix: ~
|
||||||
parent: ~
|
parent: ~
|
||||||
- kind:
|
|
||||||
name: ArgumentDefaultInStub
|
|
||||||
body: Only simple default values allowed for arguments
|
|
||||||
suggestion: ~
|
|
||||||
fixable: false
|
|
||||||
location:
|
|
||||||
row: 7
|
|
||||||
column: 6
|
|
||||||
end_location:
|
|
||||||
row: 11
|
|
||||||
column: 5
|
|
||||||
fix: ~
|
|
||||||
parent: ~
|
|
||||||
- kind:
|
|
||||||
name: ArgumentDefaultInStub
|
|
||||||
body: Only simple default values allowed for arguments
|
|
||||||
suggestion: ~
|
|
||||||
fixable: false
|
|
||||||
location:
|
|
||||||
row: 14
|
|
||||||
column: 6
|
|
||||||
end_location:
|
|
||||||
row: 18
|
|
||||||
column: 5
|
|
||||||
fix: ~
|
|
||||||
parent: ~
|
|
||||||
- kind:
|
|
||||||
name: ArgumentDefaultInStub
|
|
||||||
body: Only simple default values allowed for arguments
|
|
||||||
suggestion: ~
|
|
||||||
fixable: false
|
|
||||||
location:
|
|
||||||
row: 21
|
|
||||||
column: 6
|
|
||||||
end_location:
|
|
||||||
row: 25
|
|
||||||
column: 5
|
|
||||||
fix: ~
|
|
||||||
parent: ~
|
|
||||||
- kind:
|
|
||||||
name: ArgumentDefaultInStub
|
|
||||||
body: Only simple default values allowed for arguments
|
|
||||||
suggestion: ~
|
|
||||||
fixable: false
|
|
||||||
location:
|
|
||||||
row: 27
|
|
||||||
column: 10
|
|
||||||
end_location:
|
|
||||||
row: 27
|
|
||||||
column: 45
|
|
||||||
fix: ~
|
|
||||||
parent: ~
|
|
||||||
- kind:
|
- kind:
|
||||||
name: ArgumentDefaultInStub
|
name: ArgumentDefaultInStub
|
||||||
body: Only simple default values allowed for arguments
|
body: Only simple default values allowed for arguments
|
||||||
|
|
@ -76,8 +24,8 @@ expression: diagnostics
|
||||||
row: 29
|
row: 29
|
||||||
column: 6
|
column: 6
|
||||||
end_location:
|
end_location:
|
||||||
row: 29
|
row: 32
|
||||||
column: 19
|
column: 5
|
||||||
fix: ~
|
fix: ~
|
||||||
parent: ~
|
parent: ~
|
||||||
- kind:
|
- kind:
|
||||||
|
|
@ -86,10 +34,49 @@ expression: diagnostics
|
||||||
suggestion: ~
|
suggestion: ~
|
||||||
fixable: false
|
fixable: false
|
||||||
location:
|
location:
|
||||||
row: 32
|
row: 35
|
||||||
column: 6
|
column: 6
|
||||||
end_location:
|
end_location:
|
||||||
row: 32
|
row: 47
|
||||||
|
column: 5
|
||||||
|
fix: ~
|
||||||
|
parent: ~
|
||||||
|
- kind:
|
||||||
|
name: ArgumentDefaultInStub
|
||||||
|
body: Only simple default values allowed for arguments
|
||||||
|
suggestion: ~
|
||||||
|
fixable: false
|
||||||
|
location:
|
||||||
|
row: 50
|
||||||
|
column: 6
|
||||||
|
end_location:
|
||||||
|
row: 53
|
||||||
|
column: 5
|
||||||
|
fix: ~
|
||||||
|
parent: ~
|
||||||
|
- kind:
|
||||||
|
name: ArgumentDefaultInStub
|
||||||
|
body: Only simple default values allowed for arguments
|
||||||
|
suggestion: ~
|
||||||
|
fixable: false
|
||||||
|
location:
|
||||||
|
row: 56
|
||||||
|
column: 6
|
||||||
|
end_location:
|
||||||
|
row: 56
|
||||||
|
column: 18
|
||||||
|
fix: ~
|
||||||
|
parent: ~
|
||||||
|
- kind:
|
||||||
|
name: ArgumentDefaultInStub
|
||||||
|
body: Only simple default values allowed for arguments
|
||||||
|
suggestion: ~
|
||||||
|
fixable: false
|
||||||
|
location:
|
||||||
|
row: 59
|
||||||
|
column: 6
|
||||||
|
end_location:
|
||||||
|
row: 59
|
||||||
column: 21
|
column: 21
|
||||||
fix: ~
|
fix: ~
|
||||||
parent: ~
|
parent: ~
|
||||||
|
|
@ -99,10 +86,49 @@ expression: diagnostics
|
||||||
suggestion: ~
|
suggestion: ~
|
||||||
fixable: false
|
fixable: false
|
||||||
location:
|
location:
|
||||||
row: 35
|
row: 61
|
||||||
|
column: 10
|
||||||
|
end_location:
|
||||||
|
row: 61
|
||||||
|
column: 45
|
||||||
|
fix: ~
|
||||||
|
parent: ~
|
||||||
|
- kind:
|
||||||
|
name: ArgumentDefaultInStub
|
||||||
|
body: Only simple default values allowed for arguments
|
||||||
|
suggestion: ~
|
||||||
|
fixable: false
|
||||||
|
location:
|
||||||
|
row: 63
|
||||||
column: 6
|
column: 6
|
||||||
end_location:
|
end_location:
|
||||||
row: 35
|
row: 63
|
||||||
|
column: 19
|
||||||
|
fix: ~
|
||||||
|
parent: ~
|
||||||
|
- kind:
|
||||||
|
name: ArgumentDefaultInStub
|
||||||
|
body: Only simple default values allowed for arguments
|
||||||
|
suggestion: ~
|
||||||
|
fixable: false
|
||||||
|
location:
|
||||||
|
row: 66
|
||||||
|
column: 6
|
||||||
|
end_location:
|
||||||
|
row: 66
|
||||||
|
column: 21
|
||||||
|
fix: ~
|
||||||
|
parent: ~
|
||||||
|
- kind:
|
||||||
|
name: ArgumentDefaultInStub
|
||||||
|
body: Only simple default values allowed for arguments
|
||||||
|
suggestion: ~
|
||||||
|
fixable: false
|
||||||
|
location:
|
||||||
|
row: 69
|
||||||
|
column: 6
|
||||||
|
end_location:
|
||||||
|
row: 69
|
||||||
column: 15
|
column: 15
|
||||||
fix: ~
|
fix: ~
|
||||||
parent: ~
|
parent: ~
|
||||||
|
|
@ -112,10 +138,10 @@ expression: diagnostics
|
||||||
suggestion: ~
|
suggestion: ~
|
||||||
fixable: false
|
fixable: false
|
||||||
location:
|
location:
|
||||||
row: 38
|
row: 72
|
||||||
column: 6
|
column: 6
|
||||||
end_location:
|
end_location:
|
||||||
row: 38
|
row: 72
|
||||||
column: 11
|
column: 11
|
||||||
fix: ~
|
fix: ~
|
||||||
parent: ~
|
parent: ~
|
||||||
|
|
@ -125,10 +151,10 @@ expression: diagnostics
|
||||||
suggestion: ~
|
suggestion: ~
|
||||||
fixable: false
|
fixable: false
|
||||||
location:
|
location:
|
||||||
row: 41
|
row: 75
|
||||||
column: 6
|
column: 6
|
||||||
end_location:
|
end_location:
|
||||||
row: 41
|
row: 75
|
||||||
column: 13
|
column: 13
|
||||||
fix: ~
|
fix: ~
|
||||||
parent: ~
|
parent: ~
|
||||||
|
|
@ -138,10 +164,10 @@ expression: diagnostics
|
||||||
suggestion: ~
|
suggestion: ~
|
||||||
fixable: false
|
fixable: false
|
||||||
location:
|
location:
|
||||||
row: 44
|
row: 78
|
||||||
column: 6
|
column: 6
|
||||||
end_location:
|
end_location:
|
||||||
row: 44
|
row: 78
|
||||||
column: 19
|
column: 19
|
||||||
fix: ~
|
fix: ~
|
||||||
parent: ~
|
parent: ~
|
||||||
|
|
|
||||||
Loading…
Add table
Add a link
Reference in a new issue