---
source: crates/ruff_linter/src/rules/refurb/mod.rs
---
FURB154 [*] Use of repeated consecutive `global`
 --> FURB154.py:4:5
  |
3 |   def f1():
4 | /     global x
5 | |     global y
  | |____________^
  |
help: Merge `global` statements
  |
3 | def f1():
  -     global x
  -     global y
4 +     global x, y
5 |
  |

FURB154 [*] Use of repeated consecutive `global`
  --> FURB154.py:9:5
   |
 8 |   def f3():
 9 | /     global x
10 | |     global y
11 | |     global z
   | |____________^
   |
help: Merge `global` statements
   |
8  | def f3():
   -     global x
   -     global y
   -     global z
9  +     global x, y, z
10 |
   |

FURB154 [*] Use of repeated consecutive `global`
  --> FURB154.py:15:5
   |
14 |   def f4():
15 | /     global x
16 | |     global y
   | |____________^
17 |       pass
18 |       global x
   |
help: Merge `global` statements
   |
14 | def f4():
   -     global x
   -     global y
15 +     global x, y
16 |     pass
   |

FURB154 [*] Use of repeated consecutive `global`
  --> FURB154.py:18:5
   |
16 |       global y
17 |       pass
18 | /     global x
19 | |     global y
   | |____________^
   |
help: Merge `global` statements
   |
17 |     pass
   -     global x
   -     global y
18 +     global x, y
19 |
   |

FURB154 [*] Use of repeated consecutive `nonlocal`
  --> FURB154.py:26:9
   |
25 |       def inner():
26 | /         nonlocal x
27 | |         nonlocal y
   | |__________________^
28 |
29 |       def inner2():
   |
help: Merge `nonlocal` statements
   |
25 |     def inner():
   -         nonlocal x
   -         nonlocal y
26 +         nonlocal x, y
27 |
   |

FURB154 [*] Use of repeated consecutive `nonlocal`
  --> FURB154.py:30:9
   |
29 |       def inner2():
30 | /         nonlocal x
31 | |         nonlocal y
32 | |         nonlocal z
   | |__________________^
33 |
34 |       def inner3():
   |
help: Merge `nonlocal` statements
   |
29 |     def inner2():
   -         nonlocal x
   -         nonlocal y
   -         nonlocal z
30 +         nonlocal x, y, z
31 |
   |

FURB154 [*] Use of repeated consecutive `nonlocal`
  --> FURB154.py:35:9
   |
34 |       def inner3():
35 | /         nonlocal x
36 | |         nonlocal y
   | |__________________^
37 |           pass
38 |           nonlocal x
   |
help: Merge `nonlocal` statements
   |
34 |     def inner3():
   -         nonlocal x
   -         nonlocal y
35 +         nonlocal x, y
36 |         pass
   |

FURB154 [*] Use of repeated consecutive `nonlocal`
  --> FURB154.py:38:9
   |
36 |           nonlocal y
37 |           pass
38 | /         nonlocal x
39 | |         nonlocal y
   | |__________________^
   |
help: Merge `nonlocal` statements
   |
37 |         pass
   -         nonlocal x
   -         nonlocal y
38 +         nonlocal x, y
39 |
   |

FURB154 [*] Use of repeated consecutive `global`
  --> FURB154.py:46:9
   |
45 |       def inner():
46 | /         global w
47 | |         global x
   | |________________^
48 |           nonlocal y
49 |           nonlocal z
   |
help: Merge `global` statements
   |
45 |     def inner():
   -         global w
   -         global x
46 +         global w, x
47 |         nonlocal y
   |

FURB154 [*] Use of repeated consecutive `nonlocal`
  --> FURB154.py:48:9
   |
46 |           global w
47 |           global x
48 | /         nonlocal y
49 | |         nonlocal z
   | |__________________^
50 |
51 |       def inner2():
   |
help: Merge `nonlocal` statements
   |
47 |         global x
   -         nonlocal y
   -         nonlocal z
48 +         nonlocal y, z
49 |
   |

FURB154 [*] Use of repeated consecutive `nonlocal`
  --> FURB154.py:53:9
   |
51 |       def inner2():
52 |           global x
53 | /         nonlocal y
54 | |         nonlocal z
   | |__________________^
   |
help: Merge `nonlocal` statements
   |
52 |         global x
   -         nonlocal y
   -         nonlocal z
53 +         nonlocal y, z
54 |
   |

FURB154 [*] Use of repeated consecutive `global`
  --> FURB154.py:58:5
   |
57 |   def f6():
58 | /     global x, y, z
59 | |     global a, b, c
60 | |     global d, e, f
   | |__________________^
   |
help: Merge `global` statements
   |
57 | def f6():
   -     global x, y, z
   -     global a, b, c
   -     global d, e, f
58 +     global x, y, z, a, b, c, d, e, f
59 |
   |

FURB154 [*] Use of repeated consecutive `global`
  --> FURB154.py:90:5
   |
89 |   def func():
90 | /     global x
91 | |     # text
92 | |     global y
   | |____________^
93 |
94 |       print(x, y)
   |
help: Merge `global` statements
   |
89 | def func():
   -     global x
   -     # text
   -     global y
90 +     global x, y
91 |
   |
note: This is an unsafe fix and may change runtime behavior
