mirror of https://github.com/astral-sh/ruff
Use inline snapshots in `# noqa` unit tests (#16687)
## Summary Follow-up to #16677. This change converts all unit tests (69 of them) in `noqa.rs` to use inline snapshots instead. It extends the file by more than 1000 lines, but the tests are now much easier to read and reason about. ## Test Plan `cargo insta test`.
This commit is contained in:
parent
16b0902e28
commit
c605ce6fe2
File diff suppressed because it is too large
Load Diff
|
|
@ -1,6 +1,5 @@
|
||||||
---
|
---
|
||||||
source: crates/ruff_linter/src/linter.rs
|
source: crates/ruff_linter/src/linter.rs
|
||||||
snapshot_kind: text
|
|
||||||
---
|
---
|
||||||
undefined_name.ipynb:cell 3:1:7: F821 Undefined name `undefined`
|
undefined_name.ipynb:cell 3:1:7: F821 Undefined name `undefined`
|
||||||
|
|
|
|
||||||
|
|
|
||||||
|
|
@ -1,6 +1,5 @@
|
||||||
---
|
---
|
||||||
source: crates/ruff_linter/src/linter.rs
|
source: crates/ruff_linter/src/linter.rs
|
||||||
snapshot_kind: text
|
|
||||||
---
|
---
|
||||||
unused_variable.ipynb:cell 1:2:5: F841 [*] Local variable `foo1` is assigned to but never used
|
unused_variable.ipynb:cell 1:2:5: F841 [*] Local variable `foo1` is assigned to but never used
|
||||||
|
|
|
|
||||||
|
|
|
||||||
|
|
@ -1,16 +0,0 @@
|
||||||
---
|
|
||||||
source: crates/ruff_linter/src/noqa.rs
|
|
||||||
expression: exemption
|
|
||||||
---
|
|
||||||
Ok(
|
|
||||||
Some(
|
|
||||||
NoqaLexerOutput {
|
|
||||||
warnings: [],
|
|
||||||
directive: All(
|
|
||||||
All {
|
|
||||||
range: 0..14,
|
|
||||||
},
|
|
||||||
),
|
|
||||||
},
|
|
||||||
),
|
|
||||||
)
|
|
||||||
|
|
@ -1,16 +0,0 @@
|
||||||
---
|
|
||||||
source: crates/ruff_linter/src/noqa.rs
|
|
||||||
expression: exemption
|
|
||||||
---
|
|
||||||
Ok(
|
|
||||||
Some(
|
|
||||||
NoqaLexerOutput {
|
|
||||||
warnings: [],
|
|
||||||
directive: All(
|
|
||||||
All {
|
|
||||||
range: 0..14,
|
|
||||||
},
|
|
||||||
),
|
|
||||||
},
|
|
||||||
),
|
|
||||||
)
|
|
||||||
|
|
@ -1,16 +0,0 @@
|
||||||
---
|
|
||||||
source: crates/ruff_linter/src/noqa.rs
|
|
||||||
expression: exemption
|
|
||||||
---
|
|
||||||
Ok(
|
|
||||||
Some(
|
|
||||||
NoqaLexerOutput {
|
|
||||||
warnings: [],
|
|
||||||
directive: All(
|
|
||||||
All {
|
|
||||||
range: 0..12,
|
|
||||||
},
|
|
||||||
),
|
|
||||||
},
|
|
||||||
),
|
|
||||||
)
|
|
||||||
|
|
@ -1,26 +0,0 @@
|
||||||
---
|
|
||||||
source: crates/ruff_linter/src/noqa.rs
|
|
||||||
expression: exemption
|
|
||||||
---
|
|
||||||
Ok(
|
|
||||||
Some(
|
|
||||||
NoqaLexerOutput {
|
|
||||||
warnings: [],
|
|
||||||
directive: Codes(
|
|
||||||
Codes {
|
|
||||||
range: 0..26,
|
|
||||||
codes: [
|
|
||||||
Code {
|
|
||||||
code: "F401",
|
|
||||||
range: 16..20,
|
|
||||||
},
|
|
||||||
Code {
|
|
||||||
code: "F841",
|
|
||||||
range: 22..26,
|
|
||||||
},
|
|
||||||
],
|
|
||||||
},
|
|
||||||
),
|
|
||||||
},
|
|
||||||
),
|
|
||||||
)
|
|
||||||
|
|
@ -1,7 +0,0 @@
|
||||||
---
|
|
||||||
source: crates/ruff_linter/src/noqa.rs
|
|
||||||
expression: directive
|
|
||||||
---
|
|
||||||
Err(
|
|
||||||
MissingCodes,
|
|
||||||
)
|
|
||||||
|
|
@ -1,22 +0,0 @@
|
||||||
---
|
|
||||||
source: crates/ruff_linter/src/noqa.rs
|
|
||||||
expression: directive
|
|
||||||
---
|
|
||||||
Ok(
|
|
||||||
Some(
|
|
||||||
NoqaLexerOutput {
|
|
||||||
warnings: [],
|
|
||||||
directive: Codes(
|
|
||||||
Codes {
|
|
||||||
range: 0..22,
|
|
||||||
codes: [
|
|
||||||
Code {
|
|
||||||
code: "RUF001",
|
|
||||||
range: 16..22,
|
|
||||||
},
|
|
||||||
],
|
|
||||||
},
|
|
||||||
),
|
|
||||||
},
|
|
||||||
),
|
|
||||||
)
|
|
||||||
|
|
@ -1,7 +0,0 @@
|
||||||
---
|
|
||||||
source: crates/ruff_linter/src/noqa.rs
|
|
||||||
expression: directive
|
|
||||||
---
|
|
||||||
Err(
|
|
||||||
InvalidCodeSuffix,
|
|
||||||
)
|
|
||||||
|
|
@ -1,7 +0,0 @@
|
||||||
---
|
|
||||||
source: crates/ruff_linter/src/noqa.rs
|
|
||||||
expression: exemption
|
|
||||||
---
|
|
||||||
Err(
|
|
||||||
MissingCodes,
|
|
||||||
)
|
|
||||||
|
|
@ -1,7 +0,0 @@
|
||||||
---
|
|
||||||
source: crates/ruff_linter/src/noqa.rs
|
|
||||||
expression: exemption
|
|
||||||
---
|
|
||||||
Err(
|
|
||||||
MissingCodes,
|
|
||||||
)
|
|
||||||
|
|
@ -1,7 +0,0 @@
|
||||||
---
|
|
||||||
source: crates/ruff_linter/src/noqa.rs
|
|
||||||
expression: exemption
|
|
||||||
---
|
|
||||||
Err(
|
|
||||||
MissingCodes,
|
|
||||||
)
|
|
||||||
|
|
@ -1,7 +0,0 @@
|
||||||
---
|
|
||||||
source: crates/ruff_linter/src/noqa.rs
|
|
||||||
expression: directive
|
|
||||||
---
|
|
||||||
Err(
|
|
||||||
MissingCodes,
|
|
||||||
)
|
|
||||||
|
|
@ -1,22 +0,0 @@
|
||||||
---
|
|
||||||
source: crates/ruff_linter/src/noqa.rs
|
|
||||||
expression: directive
|
|
||||||
---
|
|
||||||
Ok(
|
|
||||||
Some(
|
|
||||||
NoqaLexerOutput {
|
|
||||||
warnings: [],
|
|
||||||
directive: Codes(
|
|
||||||
Codes {
|
|
||||||
range: 0..14,
|
|
||||||
codes: [
|
|
||||||
Code {
|
|
||||||
code: "RUF001",
|
|
||||||
range: 8..14,
|
|
||||||
},
|
|
||||||
],
|
|
||||||
},
|
|
||||||
),
|
|
||||||
},
|
|
||||||
),
|
|
||||||
)
|
|
||||||
|
|
@ -1,7 +0,0 @@
|
||||||
---
|
|
||||||
source: crates/ruff_linter/src/noqa.rs
|
|
||||||
expression: directive
|
|
||||||
---
|
|
||||||
Err(
|
|
||||||
InvalidCodeSuffix,
|
|
||||||
)
|
|
||||||
|
|
@ -1,16 +0,0 @@
|
||||||
---
|
|
||||||
source: crates/ruff_linter/src/noqa.rs
|
|
||||||
expression: directive
|
|
||||||
---
|
|
||||||
Ok(
|
|
||||||
Some(
|
|
||||||
NoqaLexerOutput {
|
|
||||||
warnings: [],
|
|
||||||
directive: All(
|
|
||||||
All {
|
|
||||||
range: 0..6,
|
|
||||||
},
|
|
||||||
),
|
|
||||||
},
|
|
||||||
),
|
|
||||||
)
|
|
||||||
|
|
@ -1,16 +0,0 @@
|
||||||
---
|
|
||||||
source: crates/ruff_linter/src/noqa.rs
|
|
||||||
expression: directive
|
|
||||||
---
|
|
||||||
Ok(
|
|
||||||
Some(
|
|
||||||
NoqaLexerOutput {
|
|
||||||
warnings: [],
|
|
||||||
directive: All(
|
|
||||||
All {
|
|
||||||
range: 0..6,
|
|
||||||
},
|
|
||||||
),
|
|
||||||
},
|
|
||||||
),
|
|
||||||
)
|
|
||||||
|
|
@ -1,16 +0,0 @@
|
||||||
---
|
|
||||||
source: crates/ruff_linter/src/noqa.rs
|
|
||||||
expression: directive
|
|
||||||
---
|
|
||||||
Ok(
|
|
||||||
Some(
|
|
||||||
NoqaLexerOutput {
|
|
||||||
warnings: [],
|
|
||||||
directive: All(
|
|
||||||
All {
|
|
||||||
range: 35..41,
|
|
||||||
},
|
|
||||||
),
|
|
||||||
},
|
|
||||||
),
|
|
||||||
)
|
|
||||||
|
|
@ -1,16 +0,0 @@
|
||||||
---
|
|
||||||
source: crates/ruff_linter/src/noqa.rs
|
|
||||||
expression: directive
|
|
||||||
---
|
|
||||||
Ok(
|
|
||||||
Some(
|
|
||||||
NoqaLexerOutput {
|
|
||||||
warnings: [],
|
|
||||||
directive: All(
|
|
||||||
All {
|
|
||||||
range: 0..7,
|
|
||||||
},
|
|
||||||
),
|
|
||||||
},
|
|
||||||
),
|
|
||||||
)
|
|
||||||
|
|
@ -1,16 +0,0 @@
|
||||||
---
|
|
||||||
source: crates/ruff_linter/src/noqa.rs
|
|
||||||
expression: directive
|
|
||||||
---
|
|
||||||
Ok(
|
|
||||||
Some(
|
|
||||||
NoqaLexerOutput {
|
|
||||||
warnings: [],
|
|
||||||
directive: All(
|
|
||||||
All {
|
|
||||||
range: 0..5,
|
|
||||||
},
|
|
||||||
),
|
|
||||||
},
|
|
||||||
),
|
|
||||||
)
|
|
||||||
|
|
@ -1,16 +0,0 @@
|
||||||
---
|
|
||||||
source: crates/ruff_linter/src/noqa.rs
|
|
||||||
expression: directive
|
|
||||||
---
|
|
||||||
Ok(
|
|
||||||
Some(
|
|
||||||
NoqaLexerOutput {
|
|
||||||
warnings: [],
|
|
||||||
directive: All(
|
|
||||||
All {
|
|
||||||
range: 0..6,
|
|
||||||
},
|
|
||||||
),
|
|
||||||
},
|
|
||||||
),
|
|
||||||
)
|
|
||||||
|
|
@ -1,22 +0,0 @@
|
||||||
---
|
|
||||||
source: crates/ruff_linter/src/noqa.rs
|
|
||||||
expression: directive
|
|
||||||
---
|
|
||||||
Ok(
|
|
||||||
Some(
|
|
||||||
NoqaLexerOutput {
|
|
||||||
warnings: [],
|
|
||||||
directive: Codes(
|
|
||||||
Codes {
|
|
||||||
range: 0..12,
|
|
||||||
codes: [
|
|
||||||
Code {
|
|
||||||
code: "F401",
|
|
||||||
range: 8..12,
|
|
||||||
},
|
|
||||||
],
|
|
||||||
},
|
|
||||||
),
|
|
||||||
},
|
|
||||||
),
|
|
||||||
)
|
|
||||||
|
|
@ -1,22 +0,0 @@
|
||||||
---
|
|
||||||
source: crates/ruff_linter/src/noqa.rs
|
|
||||||
expression: directive
|
|
||||||
---
|
|
||||||
Ok(
|
|
||||||
Some(
|
|
||||||
NoqaLexerOutput {
|
|
||||||
warnings: [],
|
|
||||||
directive: Codes(
|
|
||||||
Codes {
|
|
||||||
range: 0..12,
|
|
||||||
codes: [
|
|
||||||
Code {
|
|
||||||
code: "F401",
|
|
||||||
range: 8..12,
|
|
||||||
},
|
|
||||||
],
|
|
||||||
},
|
|
||||||
),
|
|
||||||
},
|
|
||||||
),
|
|
||||||
)
|
|
||||||
|
|
@ -1,7 +0,0 @@
|
||||||
---
|
|
||||||
source: crates/ruff_linter/src/noqa.rs
|
|
||||||
expression: directive
|
|
||||||
---
|
|
||||||
Err(
|
|
||||||
InvalidCodeSuffix,
|
|
||||||
)
|
|
||||||
|
|
@ -1,22 +0,0 @@
|
||||||
---
|
|
||||||
source: crates/ruff_linter/src/noqa.rs
|
|
||||||
expression: directive
|
|
||||||
---
|
|
||||||
Ok(
|
|
||||||
Some(
|
|
||||||
NoqaLexerOutput {
|
|
||||||
warnings: [],
|
|
||||||
directive: Codes(
|
|
||||||
Codes {
|
|
||||||
range: 35..47,
|
|
||||||
codes: [
|
|
||||||
Code {
|
|
||||||
code: "F401",
|
|
||||||
range: 43..47,
|
|
||||||
},
|
|
||||||
],
|
|
||||||
},
|
|
||||||
),
|
|
||||||
},
|
|
||||||
),
|
|
||||||
)
|
|
||||||
|
|
@ -1,22 +0,0 @@
|
||||||
---
|
|
||||||
source: crates/ruff_linter/src/noqa.rs
|
|
||||||
expression: directive
|
|
||||||
---
|
|
||||||
Ok(
|
|
||||||
Some(
|
|
||||||
NoqaLexerOutput {
|
|
||||||
warnings: [],
|
|
||||||
directive: Codes(
|
|
||||||
Codes {
|
|
||||||
range: 2..13,
|
|
||||||
codes: [
|
|
||||||
Code {
|
|
||||||
code: "F401",
|
|
||||||
range: 9..13,
|
|
||||||
},
|
|
||||||
],
|
|
||||||
},
|
|
||||||
),
|
|
||||||
},
|
|
||||||
),
|
|
||||||
)
|
|
||||||
|
|
@ -1,22 +0,0 @@
|
||||||
---
|
|
||||||
source: crates/ruff_linter/src/noqa.rs
|
|
||||||
expression: directive
|
|
||||||
---
|
|
||||||
Ok(
|
|
||||||
Some(
|
|
||||||
NoqaLexerOutput {
|
|
||||||
warnings: [],
|
|
||||||
directive: Codes(
|
|
||||||
Codes {
|
|
||||||
range: 6..18,
|
|
||||||
codes: [
|
|
||||||
Code {
|
|
||||||
code: "F401",
|
|
||||||
range: 14..18,
|
|
||||||
},
|
|
||||||
],
|
|
||||||
},
|
|
||||||
),
|
|
||||||
},
|
|
||||||
),
|
|
||||||
)
|
|
||||||
|
|
@ -1,22 +0,0 @@
|
||||||
---
|
|
||||||
source: crates/ruff_linter/src/noqa.rs
|
|
||||||
expression: directive
|
|
||||||
---
|
|
||||||
Ok(
|
|
||||||
Some(
|
|
||||||
NoqaLexerOutput {
|
|
||||||
warnings: [],
|
|
||||||
directive: Codes(
|
|
||||||
Codes {
|
|
||||||
range: 0..13,
|
|
||||||
codes: [
|
|
||||||
Code {
|
|
||||||
code: "F401",
|
|
||||||
range: 9..13,
|
|
||||||
},
|
|
||||||
],
|
|
||||||
},
|
|
||||||
),
|
|
||||||
},
|
|
||||||
),
|
|
||||||
)
|
|
||||||
|
|
@ -1,22 +0,0 @@
|
||||||
---
|
|
||||||
source: crates/ruff_linter/src/noqa.rs
|
|
||||||
expression: directive
|
|
||||||
---
|
|
||||||
Ok(
|
|
||||||
Some(
|
|
||||||
NoqaLexerOutput {
|
|
||||||
warnings: [],
|
|
||||||
directive: Codes(
|
|
||||||
Codes {
|
|
||||||
range: 0..10,
|
|
||||||
codes: [
|
|
||||||
Code {
|
|
||||||
code: "F401",
|
|
||||||
range: 6..10,
|
|
||||||
},
|
|
||||||
],
|
|
||||||
},
|
|
||||||
),
|
|
||||||
},
|
|
||||||
),
|
|
||||||
)
|
|
||||||
|
|
@ -1,22 +0,0 @@
|
||||||
---
|
|
||||||
source: crates/ruff_linter/src/noqa.rs
|
|
||||||
expression: directive
|
|
||||||
---
|
|
||||||
Ok(
|
|
||||||
Some(
|
|
||||||
NoqaLexerOutput {
|
|
||||||
warnings: [],
|
|
||||||
directive: Codes(
|
|
||||||
Codes {
|
|
||||||
range: 0..12,
|
|
||||||
codes: [
|
|
||||||
Code {
|
|
||||||
code: "F401",
|
|
||||||
range: 8..12,
|
|
||||||
},
|
|
||||||
],
|
|
||||||
},
|
|
||||||
),
|
|
||||||
},
|
|
||||||
),
|
|
||||||
)
|
|
||||||
|
|
@ -1,26 +0,0 @@
|
||||||
---
|
|
||||||
source: crates/ruff_linter/src/noqa.rs
|
|
||||||
expression: directive
|
|
||||||
---
|
|
||||||
Ok(
|
|
||||||
Some(
|
|
||||||
NoqaLexerOutput {
|
|
||||||
warnings: [],
|
|
||||||
directive: Codes(
|
|
||||||
Codes {
|
|
||||||
range: 0..18,
|
|
||||||
codes: [
|
|
||||||
Code {
|
|
||||||
code: "F401",
|
|
||||||
range: 8..12,
|
|
||||||
},
|
|
||||||
Code {
|
|
||||||
code: "F841",
|
|
||||||
range: 14..18,
|
|
||||||
},
|
|
||||||
],
|
|
||||||
},
|
|
||||||
),
|
|
||||||
},
|
|
||||||
),
|
|
||||||
)
|
|
||||||
|
|
@ -1,26 +0,0 @@
|
||||||
---
|
|
||||||
source: crates/ruff_linter/src/noqa.rs
|
|
||||||
expression: directive
|
|
||||||
---
|
|
||||||
Ok(
|
|
||||||
Some(
|
|
||||||
NoqaLexerOutput {
|
|
||||||
warnings: [],
|
|
||||||
directive: Codes(
|
|
||||||
Codes {
|
|
||||||
range: 0..18,
|
|
||||||
codes: [
|
|
||||||
Code {
|
|
||||||
code: "F401",
|
|
||||||
range: 8..12,
|
|
||||||
},
|
|
||||||
Code {
|
|
||||||
code: "F841",
|
|
||||||
range: 14..18,
|
|
||||||
},
|
|
||||||
],
|
|
||||||
},
|
|
||||||
),
|
|
||||||
},
|
|
||||||
),
|
|
||||||
)
|
|
||||||
|
|
@ -1,26 +0,0 @@
|
||||||
---
|
|
||||||
source: crates/ruff_linter/src/noqa.rs
|
|
||||||
expression: directive
|
|
||||||
---
|
|
||||||
Ok(
|
|
||||||
Some(
|
|
||||||
NoqaLexerOutput {
|
|
||||||
warnings: [],
|
|
||||||
directive: Codes(
|
|
||||||
Codes {
|
|
||||||
range: 35..53,
|
|
||||||
codes: [
|
|
||||||
Code {
|
|
||||||
code: "F401",
|
|
||||||
range: 43..47,
|
|
||||||
},
|
|
||||||
Code {
|
|
||||||
code: "F841",
|
|
||||||
range: 49..53,
|
|
||||||
},
|
|
||||||
],
|
|
||||||
},
|
|
||||||
),
|
|
||||||
},
|
|
||||||
),
|
|
||||||
)
|
|
||||||
|
|
@ -1,26 +0,0 @@
|
||||||
---
|
|
||||||
source: crates/ruff_linter/src/noqa.rs
|
|
||||||
expression: directive
|
|
||||||
---
|
|
||||||
Ok(
|
|
||||||
Some(
|
|
||||||
NoqaLexerOutput {
|
|
||||||
warnings: [],
|
|
||||||
directive: Codes(
|
|
||||||
Codes {
|
|
||||||
range: 0..20,
|
|
||||||
codes: [
|
|
||||||
Code {
|
|
||||||
code: "F401",
|
|
||||||
range: 9..13,
|
|
||||||
},
|
|
||||||
Code {
|
|
||||||
code: "F841",
|
|
||||||
range: 16..20,
|
|
||||||
},
|
|
||||||
],
|
|
||||||
},
|
|
||||||
),
|
|
||||||
},
|
|
||||||
),
|
|
||||||
)
|
|
||||||
|
|
@ -1,26 +0,0 @@
|
||||||
---
|
|
||||||
source: crates/ruff_linter/src/noqa.rs
|
|
||||||
expression: directive
|
|
||||||
---
|
|
||||||
Ok(
|
|
||||||
Some(
|
|
||||||
NoqaLexerOutput {
|
|
||||||
warnings: [],
|
|
||||||
directive: Codes(
|
|
||||||
Codes {
|
|
||||||
range: 0..15,
|
|
||||||
codes: [
|
|
||||||
Code {
|
|
||||||
code: "F401",
|
|
||||||
range: 6..10,
|
|
||||||
},
|
|
||||||
Code {
|
|
||||||
code: "F841",
|
|
||||||
range: 11..15,
|
|
||||||
},
|
|
||||||
],
|
|
||||||
},
|
|
||||||
),
|
|
||||||
},
|
|
||||||
),
|
|
||||||
)
|
|
||||||
|
|
@ -1,26 +0,0 @@
|
||||||
---
|
|
||||||
source: crates/ruff_linter/src/noqa.rs
|
|
||||||
expression: directive
|
|
||||||
---
|
|
||||||
Ok(
|
|
||||||
Some(
|
|
||||||
NoqaLexerOutput {
|
|
||||||
warnings: [],
|
|
||||||
directive: Codes(
|
|
||||||
Codes {
|
|
||||||
range: 0..18,
|
|
||||||
codes: [
|
|
||||||
Code {
|
|
||||||
code: "F401",
|
|
||||||
range: 8..12,
|
|
||||||
},
|
|
||||||
Code {
|
|
||||||
code: "F841",
|
|
||||||
range: 14..18,
|
|
||||||
},
|
|
||||||
],
|
|
||||||
},
|
|
||||||
),
|
|
||||||
},
|
|
||||||
),
|
|
||||||
)
|
|
||||||
|
|
@ -1,30 +0,0 @@
|
||||||
---
|
|
||||||
source: crates/ruff_linter/src/noqa.rs
|
|
||||||
expression: directive
|
|
||||||
---
|
|
||||||
Ok(
|
|
||||||
Some(
|
|
||||||
NoqaLexerOutput {
|
|
||||||
warnings: [
|
|
||||||
MissingItem(
|
|
||||||
13..13,
|
|
||||||
),
|
|
||||||
],
|
|
||||||
directive: Codes(
|
|
||||||
Codes {
|
|
||||||
range: 0..18,
|
|
||||||
codes: [
|
|
||||||
Code {
|
|
||||||
code: "F401",
|
|
||||||
range: 8..12,
|
|
||||||
},
|
|
||||||
Code {
|
|
||||||
code: "F841",
|
|
||||||
range: 14..18,
|
|
||||||
},
|
|
||||||
],
|
|
||||||
},
|
|
||||||
),
|
|
||||||
},
|
|
||||||
),
|
|
||||||
)
|
|
||||||
|
|
@ -1,30 +0,0 @@
|
||||||
---
|
|
||||||
source: crates/ruff_linter/src/noqa.rs
|
|
||||||
expression: directive
|
|
||||||
---
|
|
||||||
Ok(
|
|
||||||
Some(
|
|
||||||
NoqaLexerOutput {
|
|
||||||
warnings: [
|
|
||||||
MissingItem(
|
|
||||||
13..14,
|
|
||||||
),
|
|
||||||
],
|
|
||||||
directive: Codes(
|
|
||||||
Codes {
|
|
||||||
range: 0..19,
|
|
||||||
codes: [
|
|
||||||
Code {
|
|
||||||
code: "F401",
|
|
||||||
range: 8..12,
|
|
||||||
},
|
|
||||||
Code {
|
|
||||||
code: "F841",
|
|
||||||
range: 15..19,
|
|
||||||
},
|
|
||||||
],
|
|
||||||
},
|
|
||||||
),
|
|
||||||
},
|
|
||||||
),
|
|
||||||
)
|
|
||||||
|
|
@ -1,8 +0,0 @@
|
||||||
---
|
|
||||||
source: crates/ruff_linter/src/noqa.rs
|
|
||||||
expression: "Directive::try_extract(source, TextSize::default())"
|
|
||||||
snapshot_kind: text
|
|
||||||
---
|
|
||||||
Err(
|
|
||||||
MissingCodes,
|
|
||||||
)
|
|
||||||
|
|
@ -1,8 +0,0 @@
|
||||||
---
|
|
||||||
source: crates/ruff_linter/src/noqa.rs
|
|
||||||
expression: "Directive::try_extract(source, TextSize::default())"
|
|
||||||
snapshot_kind: text
|
|
||||||
---
|
|
||||||
Err(
|
|
||||||
InvalidSuffix,
|
|
||||||
)
|
|
||||||
|
|
@ -1,22 +0,0 @@
|
||||||
---
|
|
||||||
source: crates/ruff_linter/src/noqa.rs
|
|
||||||
expression: directive
|
|
||||||
---
|
|
||||||
Ok(
|
|
||||||
Some(
|
|
||||||
NoqaLexerOutput {
|
|
||||||
warnings: [],
|
|
||||||
directive: Codes(
|
|
||||||
Codes {
|
|
||||||
range: 4..16,
|
|
||||||
codes: [
|
|
||||||
Code {
|
|
||||||
code: "F401",
|
|
||||||
range: 12..16,
|
|
||||||
},
|
|
||||||
],
|
|
||||||
},
|
|
||||||
),
|
|
||||||
},
|
|
||||||
),
|
|
||||||
)
|
|
||||||
|
|
@ -1,20 +0,0 @@
|
||||||
---
|
|
||||||
source: crates/ruff_linter/src/noqa.rs
|
|
||||||
expression: lex_codes(&source)
|
|
||||||
---
|
|
||||||
Ok(
|
|
||||||
[
|
|
||||||
Code {
|
|
||||||
code: "F401",
|
|
||||||
range: 1..5,
|
|
||||||
},
|
|
||||||
Code {
|
|
||||||
code: "F402",
|
|
||||||
range: 7..11,
|
|
||||||
},
|
|
||||||
Code {
|
|
||||||
code: "F403",
|
|
||||||
range: 11..15,
|
|
||||||
},
|
|
||||||
],
|
|
||||||
)
|
|
||||||
|
|
@ -1,7 +0,0 @@
|
||||||
---
|
|
||||||
source: crates/ruff_linter/src/noqa.rs
|
|
||||||
expression: "Directive::try_extract(source, TextSize::default())"
|
|
||||||
---
|
|
||||||
Err(
|
|
||||||
MissingCodes,
|
|
||||||
)
|
|
||||||
|
|
@ -1,7 +0,0 @@
|
||||||
---
|
|
||||||
source: crates/ruff_linter/src/noqa.rs
|
|
||||||
expression: "Directive::try_extract(source, TextSize::default())"
|
|
||||||
---
|
|
||||||
Err(
|
|
||||||
MissingCodes,
|
|
||||||
)
|
|
||||||
|
|
@ -1,7 +0,0 @@
|
||||||
---
|
|
||||||
source: crates/ruff_linter/src/noqa.rs
|
|
||||||
expression: "Directive::try_extract(source, TextSize::default())"
|
|
||||||
---
|
|
||||||
Err(
|
|
||||||
MissingCodes,
|
|
||||||
)
|
|
||||||
|
|
@ -1,22 +0,0 @@
|
||||||
---
|
|
||||||
source: crates/ruff_linter/src/noqa.rs
|
|
||||||
expression: directive
|
|
||||||
---
|
|
||||||
Ok(
|
|
||||||
Some(
|
|
||||||
NoqaLexerOutput {
|
|
||||||
warnings: [],
|
|
||||||
directive: Codes(
|
|
||||||
Codes {
|
|
||||||
range: 0..12,
|
|
||||||
codes: [
|
|
||||||
Code {
|
|
||||||
code: "F401",
|
|
||||||
range: 8..12,
|
|
||||||
},
|
|
||||||
],
|
|
||||||
},
|
|
||||||
),
|
|
||||||
},
|
|
||||||
),
|
|
||||||
)
|
|
||||||
|
|
@ -1,30 +0,0 @@
|
||||||
---
|
|
||||||
source: crates/ruff_linter/src/noqa.rs
|
|
||||||
expression: directive
|
|
||||||
---
|
|
||||||
Ok(
|
|
||||||
Some(
|
|
||||||
NoqaLexerOutput {
|
|
||||||
warnings: [
|
|
||||||
MissingDelimiter(
|
|
||||||
12..12,
|
|
||||||
),
|
|
||||||
],
|
|
||||||
directive: Codes(
|
|
||||||
Codes {
|
|
||||||
range: 0..16,
|
|
||||||
codes: [
|
|
||||||
Code {
|
|
||||||
code: "F401",
|
|
||||||
range: 8..12,
|
|
||||||
},
|
|
||||||
Code {
|
|
||||||
code: "F841",
|
|
||||||
range: 12..16,
|
|
||||||
},
|
|
||||||
],
|
|
||||||
},
|
|
||||||
),
|
|
||||||
},
|
|
||||||
),
|
|
||||||
)
|
|
||||||
|
|
@ -1,22 +0,0 @@
|
||||||
---
|
|
||||||
source: crates/ruff_linter/src/noqa.rs
|
|
||||||
expression: directive
|
|
||||||
---
|
|
||||||
Ok(
|
|
||||||
Some(
|
|
||||||
NoqaLexerOutput {
|
|
||||||
warnings: [],
|
|
||||||
directive: Codes(
|
|
||||||
Codes {
|
|
||||||
range: 0..12,
|
|
||||||
codes: [
|
|
||||||
Code {
|
|
||||||
code: "F401",
|
|
||||||
range: 8..12,
|
|
||||||
},
|
|
||||||
],
|
|
||||||
},
|
|
||||||
),
|
|
||||||
},
|
|
||||||
),
|
|
||||||
)
|
|
||||||
|
|
@ -1,16 +0,0 @@
|
||||||
---
|
|
||||||
source: crates/ruff_linter/src/noqa.rs
|
|
||||||
expression: exemption
|
|
||||||
---
|
|
||||||
Ok(
|
|
||||||
Some(
|
|
||||||
NoqaLexerOutput {
|
|
||||||
warnings: [],
|
|
||||||
directive: All(
|
|
||||||
All {
|
|
||||||
range: 0..12,
|
|
||||||
},
|
|
||||||
),
|
|
||||||
},
|
|
||||||
),
|
|
||||||
)
|
|
||||||
|
|
@ -1,16 +0,0 @@
|
||||||
---
|
|
||||||
source: crates/ruff_linter/src/noqa.rs
|
|
||||||
expression: exemption
|
|
||||||
---
|
|
||||||
Ok(
|
|
||||||
Some(
|
|
||||||
NoqaLexerOutput {
|
|
||||||
warnings: [],
|
|
||||||
directive: All(
|
|
||||||
All {
|
|
||||||
range: 0..12,
|
|
||||||
},
|
|
||||||
),
|
|
||||||
},
|
|
||||||
),
|
|
||||||
)
|
|
||||||
|
|
@ -1,16 +0,0 @@
|
||||||
---
|
|
||||||
source: crates/ruff_linter/src/noqa.rs
|
|
||||||
expression: exemption
|
|
||||||
---
|
|
||||||
Ok(
|
|
||||||
Some(
|
|
||||||
NoqaLexerOutput {
|
|
||||||
warnings: [],
|
|
||||||
directive: All(
|
|
||||||
All {
|
|
||||||
range: 18..30,
|
|
||||||
},
|
|
||||||
),
|
|
||||||
},
|
|
||||||
),
|
|
||||||
)
|
|
||||||
|
|
@ -1,16 +0,0 @@
|
||||||
---
|
|
||||||
source: crates/ruff_linter/src/noqa.rs
|
|
||||||
expression: exemption
|
|
||||||
---
|
|
||||||
Ok(
|
|
||||||
Some(
|
|
||||||
NoqaLexerOutput {
|
|
||||||
warnings: [],
|
|
||||||
directive: All(
|
|
||||||
All {
|
|
||||||
range: 0..10,
|
|
||||||
},
|
|
||||||
),
|
|
||||||
},
|
|
||||||
),
|
|
||||||
)
|
|
||||||
|
|
@ -1,16 +0,0 @@
|
||||||
---
|
|
||||||
source: crates/ruff_linter/src/noqa.rs
|
|
||||||
expression: exemption
|
|
||||||
---
|
|
||||||
Ok(
|
|
||||||
Some(
|
|
||||||
NoqaLexerOutput {
|
|
||||||
warnings: [],
|
|
||||||
directive: All(
|
|
||||||
All {
|
|
||||||
range: 0..12,
|
|
||||||
},
|
|
||||||
),
|
|
||||||
},
|
|
||||||
),
|
|
||||||
)
|
|
||||||
|
|
@ -1,16 +0,0 @@
|
||||||
---
|
|
||||||
source: crates/ruff_linter/src/noqa.rs
|
|
||||||
expression: exemption
|
|
||||||
---
|
|
||||||
Ok(
|
|
||||||
Some(
|
|
||||||
NoqaLexerOutput {
|
|
||||||
warnings: [],
|
|
||||||
directive: All(
|
|
||||||
All {
|
|
||||||
range: 0..12,
|
|
||||||
},
|
|
||||||
),
|
|
||||||
},
|
|
||||||
),
|
|
||||||
)
|
|
||||||
|
|
@ -1,16 +0,0 @@
|
||||||
---
|
|
||||||
source: crates/ruff_linter/src/noqa.rs
|
|
||||||
expression: exemption
|
|
||||||
---
|
|
||||||
Ok(
|
|
||||||
Some(
|
|
||||||
NoqaLexerOutput {
|
|
||||||
warnings: [],
|
|
||||||
directive: All(
|
|
||||||
All {
|
|
||||||
range: 0..12,
|
|
||||||
},
|
|
||||||
),
|
|
||||||
},
|
|
||||||
),
|
|
||||||
)
|
|
||||||
|
|
@ -1,22 +0,0 @@
|
||||||
---
|
|
||||||
source: crates/ruff_linter/src/noqa.rs
|
|
||||||
expression: exemption
|
|
||||||
---
|
|
||||||
Ok(
|
|
||||||
Some(
|
|
||||||
NoqaLexerOutput {
|
|
||||||
warnings: [],
|
|
||||||
directive: Codes(
|
|
||||||
Codes {
|
|
||||||
range: 18..36,
|
|
||||||
codes: [
|
|
||||||
Code {
|
|
||||||
code: "F401",
|
|
||||||
range: 32..36,
|
|
||||||
},
|
|
||||||
],
|
|
||||||
},
|
|
||||||
),
|
|
||||||
},
|
|
||||||
),
|
|
||||||
)
|
|
||||||
|
|
@ -1,22 +0,0 @@
|
||||||
---
|
|
||||||
source: crates/ruff_linter/src/noqa.rs
|
|
||||||
expression: exemption
|
|
||||||
---
|
|
||||||
Ok(
|
|
||||||
Some(
|
|
||||||
NoqaLexerOutput {
|
|
||||||
warnings: [],
|
|
||||||
directive: Codes(
|
|
||||||
Codes {
|
|
||||||
range: 0..18,
|
|
||||||
codes: [
|
|
||||||
Code {
|
|
||||||
code: "F401",
|
|
||||||
range: 14..18,
|
|
||||||
},
|
|
||||||
],
|
|
||||||
},
|
|
||||||
),
|
|
||||||
},
|
|
||||||
),
|
|
||||||
)
|
|
||||||
|
|
@ -1,22 +0,0 @@
|
||||||
---
|
|
||||||
source: crates/ruff_linter/src/noqa.rs
|
|
||||||
expression: exemption
|
|
||||||
---
|
|
||||||
Ok(
|
|
||||||
Some(
|
|
||||||
NoqaLexerOutput {
|
|
||||||
warnings: [],
|
|
||||||
directive: Codes(
|
|
||||||
Codes {
|
|
||||||
range: 0..18,
|
|
||||||
codes: [
|
|
||||||
Code {
|
|
||||||
code: "F401",
|
|
||||||
range: 14..18,
|
|
||||||
},
|
|
||||||
],
|
|
||||||
},
|
|
||||||
),
|
|
||||||
},
|
|
||||||
),
|
|
||||||
)
|
|
||||||
|
|
@ -1,22 +0,0 @@
|
||||||
---
|
|
||||||
source: crates/ruff_linter/src/noqa.rs
|
|
||||||
expression: exemption
|
|
||||||
---
|
|
||||||
Ok(
|
|
||||||
Some(
|
|
||||||
NoqaLexerOutput {
|
|
||||||
warnings: [],
|
|
||||||
directive: Codes(
|
|
||||||
Codes {
|
|
||||||
range: 0..18,
|
|
||||||
codes: [
|
|
||||||
Code {
|
|
||||||
code: "F401",
|
|
||||||
range: 14..18,
|
|
||||||
},
|
|
||||||
],
|
|
||||||
},
|
|
||||||
),
|
|
||||||
},
|
|
||||||
),
|
|
||||||
)
|
|
||||||
|
|
@ -1,26 +0,0 @@
|
||||||
---
|
|
||||||
source: crates/ruff_linter/src/noqa.rs
|
|
||||||
expression: exemption
|
|
||||||
---
|
|
||||||
Ok(
|
|
||||||
Some(
|
|
||||||
NoqaLexerOutput {
|
|
||||||
warnings: [],
|
|
||||||
directive: Codes(
|
|
||||||
Codes {
|
|
||||||
range: 0..24,
|
|
||||||
codes: [
|
|
||||||
Code {
|
|
||||||
code: "F401",
|
|
||||||
range: 14..18,
|
|
||||||
},
|
|
||||||
Code {
|
|
||||||
code: "F841",
|
|
||||||
range: 20..24,
|
|
||||||
},
|
|
||||||
],
|
|
||||||
},
|
|
||||||
),
|
|
||||||
},
|
|
||||||
),
|
|
||||||
)
|
|
||||||
|
|
@ -1,26 +0,0 @@
|
||||||
---
|
|
||||||
source: crates/ruff_linter/src/noqa.rs
|
|
||||||
expression: exemption
|
|
||||||
---
|
|
||||||
Ok(
|
|
||||||
Some(
|
|
||||||
NoqaLexerOutput {
|
|
||||||
warnings: [],
|
|
||||||
directive: Codes(
|
|
||||||
Codes {
|
|
||||||
range: 3..27,
|
|
||||||
codes: [
|
|
||||||
Code {
|
|
||||||
code: "F401",
|
|
||||||
range: 17..21,
|
|
||||||
},
|
|
||||||
Code {
|
|
||||||
code: "F841",
|
|
||||||
range: 23..27,
|
|
||||||
},
|
|
||||||
],
|
|
||||||
},
|
|
||||||
),
|
|
||||||
},
|
|
||||||
),
|
|
||||||
)
|
|
||||||
|
|
@ -1,30 +0,0 @@
|
||||||
---
|
|
||||||
source: crates/ruff_linter/src/noqa.rs
|
|
||||||
expression: exemption
|
|
||||||
---
|
|
||||||
Ok(
|
|
||||||
Some(
|
|
||||||
NoqaLexerOutput {
|
|
||||||
warnings: [
|
|
||||||
MissingItem(
|
|
||||||
19..19,
|
|
||||||
),
|
|
||||||
],
|
|
||||||
directive: Codes(
|
|
||||||
Codes {
|
|
||||||
range: 0..24,
|
|
||||||
codes: [
|
|
||||||
Code {
|
|
||||||
code: "F401",
|
|
||||||
range: 14..18,
|
|
||||||
},
|
|
||||||
Code {
|
|
||||||
code: "F841",
|
|
||||||
range: 20..24,
|
|
||||||
},
|
|
||||||
],
|
|
||||||
},
|
|
||||||
),
|
|
||||||
},
|
|
||||||
),
|
|
||||||
)
|
|
||||||
|
|
@ -1,30 +0,0 @@
|
||||||
---
|
|
||||||
source: crates/ruff_linter/src/noqa.rs
|
|
||||||
expression: exemption
|
|
||||||
---
|
|
||||||
Ok(
|
|
||||||
Some(
|
|
||||||
NoqaLexerOutput {
|
|
||||||
warnings: [
|
|
||||||
MissingItem(
|
|
||||||
19..20,
|
|
||||||
),
|
|
||||||
],
|
|
||||||
directive: Codes(
|
|
||||||
Codes {
|
|
||||||
range: 0..25,
|
|
||||||
codes: [
|
|
||||||
Code {
|
|
||||||
code: "F401",
|
|
||||||
range: 14..18,
|
|
||||||
},
|
|
||||||
Code {
|
|
||||||
code: "F841",
|
|
||||||
range: 21..25,
|
|
||||||
},
|
|
||||||
],
|
|
||||||
},
|
|
||||||
),
|
|
||||||
},
|
|
||||||
),
|
|
||||||
)
|
|
||||||
|
|
@ -1,7 +0,0 @@
|
||||||
---
|
|
||||||
source: crates/ruff_linter/src/noqa.rs
|
|
||||||
expression: exemption
|
|
||||||
---
|
|
||||||
Err(
|
|
||||||
InvalidCodeSuffix,
|
|
||||||
)
|
|
||||||
|
|
@ -1,30 +0,0 @@
|
||||||
---
|
|
||||||
source: crates/ruff_linter/src/noqa.rs
|
|
||||||
expression: exemption
|
|
||||||
---
|
|
||||||
Ok(
|
|
||||||
Some(
|
|
||||||
NoqaLexerOutput {
|
|
||||||
warnings: [
|
|
||||||
MissingDelimiter(
|
|
||||||
18..18,
|
|
||||||
),
|
|
||||||
],
|
|
||||||
directive: Codes(
|
|
||||||
Codes {
|
|
||||||
range: 0..22,
|
|
||||||
codes: [
|
|
||||||
Code {
|
|
||||||
code: "F401",
|
|
||||||
range: 14..18,
|
|
||||||
},
|
|
||||||
Code {
|
|
||||||
code: "F841",
|
|
||||||
range: 18..22,
|
|
||||||
},
|
|
||||||
],
|
|
||||||
},
|
|
||||||
),
|
|
||||||
},
|
|
||||||
),
|
|
||||||
)
|
|
||||||
|
|
@ -1,7 +0,0 @@
|
||||||
---
|
|
||||||
source: crates/ruff_linter/src/noqa.rs
|
|
||||||
expression: directive
|
|
||||||
---
|
|
||||||
Err(
|
|
||||||
MissingCodes,
|
|
||||||
)
|
|
||||||
|
|
@ -1,22 +0,0 @@
|
||||||
---
|
|
||||||
source: crates/ruff_linter/src/noqa.rs
|
|
||||||
expression: directive
|
|
||||||
---
|
|
||||||
Ok(
|
|
||||||
Some(
|
|
||||||
NoqaLexerOutput {
|
|
||||||
warnings: [],
|
|
||||||
directive: Codes(
|
|
||||||
Codes {
|
|
||||||
range: 0..20,
|
|
||||||
codes: [
|
|
||||||
Code {
|
|
||||||
code: "RUF001",
|
|
||||||
range: 14..20,
|
|
||||||
},
|
|
||||||
],
|
|
||||||
},
|
|
||||||
),
|
|
||||||
},
|
|
||||||
),
|
|
||||||
)
|
|
||||||
|
|
@ -1,7 +0,0 @@
|
||||||
---
|
|
||||||
source: crates/ruff_linter/src/noqa.rs
|
|
||||||
expression: directive
|
|
||||||
---
|
|
||||||
Err(
|
|
||||||
InvalidCodeSuffix,
|
|
||||||
)
|
|
||||||
|
|
@ -1,7 +0,0 @@
|
||||||
---
|
|
||||||
source: crates/ruff_linter/src/noqa.rs
|
|
||||||
expression: exemption
|
|
||||||
---
|
|
||||||
Err(
|
|
||||||
MissingCodes,
|
|
||||||
)
|
|
||||||
|
|
@ -1,7 +0,0 @@
|
||||||
---
|
|
||||||
source: crates/ruff_linter/src/noqa.rs
|
|
||||||
expression: exemption
|
|
||||||
---
|
|
||||||
Err(
|
|
||||||
MissingCodes,
|
|
||||||
)
|
|
||||||
|
|
@ -1,7 +0,0 @@
|
||||||
---
|
|
||||||
source: crates/ruff_linter/src/noqa.rs
|
|
||||||
expression: exemption
|
|
||||||
---
|
|
||||||
Err(
|
|
||||||
MissingCodes,
|
|
||||||
)
|
|
||||||
Loading…
Reference in New Issue