Skip to content

Commit

Permalink
Actually resolve merge conflicts
Browse files Browse the repository at this point in the history
  • Loading branch information
dhruvmanila committed Jul 27, 2023
1 parent ab91763 commit 39ad2af
Show file tree
Hide file tree
Showing 2 changed files with 3 additions and 7 deletions.
4 changes: 2 additions & 2 deletions crates/ruff/src/importer/insertion.rs
Original file line number Diff line number Diff line change
Expand Up @@ -313,7 +313,7 @@ mod tests {
fn start_of_file() -> Result<()> {
fn insert(contents: &str) -> Result<Insertion> {
let program = Suite::parse(contents, "<filename>")?;
let tokens: Vec<LexResult> = ruff_rustpython::tokenize(contents, Mode::Module);
let tokens: Vec<LexResult> = ruff_python_parser::tokenize(contents, Mode::Module);
let locator = Locator::new(contents);
let stylist = Stylist::from_tokens(&tokens, &locator);
Ok(Insertion::start_of_file(&program, &locator, &stylist))
Expand Down Expand Up @@ -424,7 +424,7 @@ x = 1
#[test]
fn start_of_block() {
fn insert(contents: &str, offset: TextSize) -> Insertion {
let tokens: Vec<LexResult> = ruff_rustpython::tokenize(contents, Mode::Module);
let tokens: Vec<LexResult> = ruff_python_parser::tokenize(contents, Mode::Module);
let locator = Locator::new(contents);
let stylist = Stylist::from_tokens(&tokens, &locator);
Insertion::start_of_block(offset, &locator, &stylist)
Expand Down
6 changes: 1 addition & 5 deletions crates/ruff_shrinking/src/main.rs
Original file line number Diff line number Diff line change
Expand Up @@ -276,11 +276,7 @@ impl Strategy for StrategyRemoveToken {
input: &'a str,
_ast: &'a Suite,
) -> Result<Box<dyn ExactSizeStringIter + 'a>> {
<<<<<<< HEAD
let token_ranges: Vec<_> = ruff_python_parser::tokenize(input)
=======
let token_ranges: Vec<_> = ruff_rustpython::tokenize(input, Mode::Module)
>>>>>>> 023d1dc72 (Use Jupyter mode for the parser with Notebook files)
let token_ranges: Vec<_> = ruff_python_parser::tokenize(input, Mode::Module)
.into_iter()
// At this point we know we have valid python code
.map(Result::unwrap)
Expand Down

0 comments on commit 39ad2af

Please sign in to comment.