Skip to content

SCR121: global-at-module-level

global statement at module level

Code SCR121
Name global-at-module-level
Category Scripts (SCR)
Default severity info
Enabled by default yes
Fix available no
ign-lint equivalent none

Reports global statements at the top level of a library module.

At module level every name is already global; the statement does nothing. It often signals a misunderstanding: Ignition library modules are loaded once per project and their module-level variables are shared by every caller, which global does not change.

Inside Perspective and event scripts global is not at module level (the script is a function body) and is not reported.

global cache
cache = {}

Use instead:

cache = {}

Corresponds to W0604 global-at-module-level.


Generated from the rule metadata by iglint generate-docs; iglint rule SCR121 prints the same page in the terminal. Source: docs/rules/SCR121.md.