From 87def5860591efd3896342ebee43974c68ac0e2b Mon Sep 17 00:00:00 2001 From: Zanie Date: Mon, 2 Oct 2023 20:19:41 -0500 Subject: [PATCH] Revert change to notebook cell iteration --- crates/ruff_cli/src/diagnostics.rs | 7 +++---- 1 file changed, 3 insertions(+), 4 deletions(-) diff --git a/crates/ruff_cli/src/diagnostics.rs b/crates/ruff_cli/src/diagnostics.rs index f098c8ee14..49d3dad2c3 100644 --- a/crates/ruff_cli/src/diagnostics.rs +++ b/crates/ruff_cli/src/diagnostics.rs @@ -286,10 +286,9 @@ pub(crate) fn lint_path( // mutated it. let src_notebook = source_kind.as_ipy_notebook().unwrap(); let mut stdout = io::stdout().lock(); - for ((idx, src_cell), dest_cell) in src_notebook - .cells() - .iter() - .enumerate() + // Cell indices are 1-based. + for ((idx, src_cell), dest_cell) in (1u32..) + .zip(src_notebook.cells().iter()) .zip(dest_notebook.cells().iter()) { let (Cell::Code(src_code_cell), Cell::Code(dest_code_cell)) =