---
source: crates/ruff/src/rules/pylint/mod.rs
---
load_before_global_declaration.py:5:11: PLE0118 Name `x` is used prior to global declaration on line 7
  |
5 | ###
6 | def f():
7 |     print(x)
  |           ^ PLE0118
8 | 
9 |     global x
  |

load_before_global_declaration.py:15:11: PLE0118 Name `x` is used prior to global declaration on line 17
   |
15 |     global x
16 | 
17 |     print(x)
   |           ^ PLE0118
18 | 
19 |     global x
   |

load_before_global_declaration.py:23:11: PLE0118 Name `x` is used prior to global declaration on line 25
   |
23 | def f():
24 |     print(x)
   |           ^ PLE0118
25 | 
26 |     global x, y
   |

load_before_global_declaration.py:33:11: PLE0118 Name `x` is used prior to global declaration on line 35
   |
33 |     global x, y
34 | 
35 |     print(x)
   |           ^ PLE0118
36 | 
37 |     global x, y
   |

load_before_global_declaration.py:41:5: PLE0118 Name `x` is used prior to global declaration on line 43
   |
41 | def f():
42 |     x = 1
   |     ^ PLE0118
43 | 
44 |     global x
   |

load_before_global_declaration.py:51:5: PLE0118 Name `x` is used prior to global declaration on line 53
   |
51 |     global x
52 | 
53 |     x = 1
   |     ^ PLE0118
54 | 
55 |     global x
   |

load_before_global_declaration.py:59:9: PLE0118 Name `x` is used prior to global declaration on line 61
   |
59 | def f():
60 |     del x
   |         ^ PLE0118
61 | 
62 |     global x, y
   |

load_before_global_declaration.py:69:9: PLE0118 Name `x` is used prior to global declaration on line 71
   |
69 |     global x, y
70 | 
71 |     del x
   |         ^ PLE0118
72 | 
73 |     global x, y
   |

load_before_global_declaration.py:77:9: PLE0118 Name `x` is used prior to global declaration on line 79
   |
77 | def f():
78 |     del x
   |         ^ PLE0118
79 | 
80 |     global x
   |

load_before_global_declaration.py:87:9: PLE0118 Name `x` is used prior to global declaration on line 89
   |
87 |     global x
88 | 
89 |     del x
   |         ^ PLE0118
90 | 
91 |     global x
   |

load_before_global_declaration.py:95:9: PLE0118 Name `x` is used prior to global declaration on line 97
   |
95 | def f():
96 |     del x
   |         ^ PLE0118
97 | 
98 |     global x, y
   |

load_before_global_declaration.py:105:9: PLE0118 Name `x` is used prior to global declaration on line 107
    |
105 |     global x, y
106 | 
107 |     del x
    |         ^ PLE0118
108 | 
109 |     global x, y
    |

load_before_global_declaration.py:113:14: PLE0118 Name `x` is used prior to global declaration on line 114
    |
113 | def f():
114 |     print(f"{x=}")
    |              ^ PLE0118
115 |     global x
    |


