---
source: crates/ruff_linter/src/linter.rs
---
F841 [*] Local variable `foo1` is assigned to but never used
 --> unused_variable.ipynb:cell 1:2:5
  |
1 | def f():
2 |     foo1 = %matplotlib --list
  |     ^^^^
3 |     foo2: list[str] = %matplotlib --list
  |
help: Remove assignment to unused variable `foo1`
 ::: cell 1
  |
1 | def f():
  -     foo1 = %matplotlib --list
2 +     %matplotlib --list
3 |     foo2: list[str] = %matplotlib --list
  |
note: This is an unsafe fix and may change runtime behavior

F841 [*] Local variable `foo2` is assigned to but never used
 --> unused_variable.ipynb:cell 1:3:5
  |
1 | def f():
2 |     foo1 = %matplotlib --list
3 |     foo2: list[str] = %matplotlib --list
  |     ^^^^
  |
help: Remove assignment to unused variable `foo2`
 ::: cell 1
  |
2 |     foo1 = %matplotlib --list
  -     foo2: list[str] = %matplotlib --list
3 +     %matplotlib --list
  |
note: This is an unsafe fix and may change runtime behavior

F841 [*] Local variable `bar1` is assigned to but never used
 --> unused_variable.ipynb:cell 2:2:5
  |
1 | def f():
2 |     bar1 = !pwd
  |     ^^^^
3 |     bar2: str = !pwd
  |
help: Remove assignment to unused variable `bar1`
 ::: cell 2
  |
1 | def f():
  -     bar1 = !pwd
2 +     !pwd
3 |     bar2: str = !pwd
  |
note: This is an unsafe fix and may change runtime behavior

F841 [*] Local variable `bar2` is assigned to but never used
 --> unused_variable.ipynb:cell 2:3:5
  |
1 | def f():
2 |     bar1 = !pwd
3 |     bar2: str = !pwd
  |     ^^^^
  |
help: Remove assignment to unused variable `bar2`
 ::: cell 2
  |
2 |     bar1 = !pwd
  -     bar2: str = !pwd
3 +     !pwd
  |
note: This is an unsafe fix and may change runtime behavior
