If a variable is not modified in a scope there is no need for the use of
global in such scope. Without this patch build fails with:
F824 `global ...` is unused: name is never assigned in scope
It is a bit difficult to find more information on that message and error
code, I found it here:
https://docs.astral.sh/ruff/rules/global-variable-not-assigned/
Signed-off-by: Martin Kletzander <mkletzan@redhat.com>
Reviewed-by: Jiri Denemark <jdenemar@redhat.com>
# Parse a comment block associate to a macro
#
def parseMacroComment(self, name, quiet=0):
- global ignored_macros
-
if name[0:2] == '__':
quiet = 1
if name in ignored_macros:
# as possible
#
def mergeFunctionComment(self, name, description, quiet=0):
- global ignored_functions
-
if name == 'main':
quiet = 1
if name[0:2] == '__':
self.lexer.push(tok)
def token(self):
- global ignored_words
-
token = self.lexer.token()
while token is not None:
if token[0] == 'comment':
else:
error = True
except Exception as e:
- global debug
if debug:
print("%s: %s" % (sys.argv[0], str(e)))
print(traceback.format_exc())