From d39e08c08030b8a53644a40e4048979a95a47cff Mon Sep 17 00:00:00 2001 From: Nathan Fritzler Date: Mon, 4 Jul 2022 22:34:45 -0600 Subject: [PATCH] Fixup the create_luacheck file and use it --- .luacheckrc | 11 ++++------- tools/create_luacheck.py | 4 ++-- 2 files changed, 6 insertions(+), 9 deletions(-) diff --git a/.luacheckrc b/.luacheckrc index 9d0b8cb2a5..72c72b48e0 100644 --- a/.luacheckrc +++ b/.luacheckrc @@ -45,11 +45,8 @@ read_globals = { ------ --GENERAL - "default", + "mcljepc_core", - --ENTITIES - "cmi", - - --HUD - "sfinv", "sfinv_buttons", "unified_inventory", "cmsg", "inventory_plus", -} \ No newline at end of file + --MAPGEN + "mcljepc_mapgen", +} diff --git a/tools/create_luacheck.py b/tools/create_luacheck.py index 8b55c13762..d3ee5d038d 100755 --- a/tools/create_luacheck.py +++ b/tools/create_luacheck.py @@ -19,7 +19,7 @@ pathlist = Path(path).rglob('*.lua') for path in pathlist: path_in_str = str(path) # print(path_in_str) - trouve = False + found = False with open(path_in_str) as f: local_vars = [] for i, line in enumerate(f.readlines()): @@ -38,7 +38,7 @@ for path in pathlist: local_vars.append(n.group('local_var')) if not found: - nb_varloc = len(variables_locales) + nb_varloc = len(local_vars) #print(path_in_str, ": -", "({} variables locales)".format(nb_varloc) if nb_varloc > 0 else '') print(', '.join(['"{}"'.format(v) for v in global_vars]))