mirror of
https://github.com/astral-sh/ruff.git
synced 2025-08-04 02:39:12 +00:00
Replace row/column based Location
with byte-offsets. (#3931)
This commit is contained in:
parent
ee91598835
commit
cab65b25da
418 changed files with 6203 additions and 7040 deletions
|
@ -1,10 +1,11 @@
|
|||
#![cfg(target_arch = "wasm32")]
|
||||
|
||||
use js_sys;
|
||||
use rustpython_parser::ast::Location;
|
||||
|
||||
use wasm_bindgen_test::*;
|
||||
|
||||
use ruff::registry::Rule;
|
||||
use ruff_python_ast::source_code::{OneIndexed, SourceLocation};
|
||||
use ruff_wasm::*;
|
||||
|
||||
macro_rules! check {
|
||||
|
@ -28,8 +29,14 @@ fn empty_config() {
|
|||
[ExpandedMessage {
|
||||
code: Rule::IfTuple.noqa_code().to_string(),
|
||||
message: "If test is a tuple, which is always `True`".to_string(),
|
||||
location: Location::new(1, 0),
|
||||
end_location: Location::new(2, 8),
|
||||
location: SourceLocation {
|
||||
row: OneIndexed::from_zero_indexed(0),
|
||||
column: OneIndexed::from_zero_indexed(0)
|
||||
},
|
||||
end_location: SourceLocation {
|
||||
row: OneIndexed::from_zero_indexed(1),
|
||||
column: OneIndexed::from_zero_indexed(8)
|
||||
},
|
||||
fix: None,
|
||||
}]
|
||||
);
|
||||
|
|
Loading…
Add table
Add a link
Reference in a new issue