From 72e53a82d7cbf01137a3bb462c49d8a9908070dd Mon Sep 17 00:00:00 2001 From: AFCMS Date: Mon, 26 Apr 2021 19:16:27 +0200 Subject: [PATCH] Basic not working script --- tools/create_luacheck.py | 22 ++++++++++++++++++++++ 1 file changed, 22 insertions(+) mode change 100644 => 100755 tools/create_luacheck.py diff --git a/tools/create_luacheck.py b/tools/create_luacheck.py old mode 100644 new mode 100755 index e69de29bb..31046a575 --- a/tools/create_luacheck.py +++ b/tools/create_luacheck.py @@ -0,0 +1,22 @@ +import os +import re +from pathlib import Path + +path = "../mods/" +pattern = re.compile(r'[a-z]') + +pathlist = Path(path).rglob('*.lua') +for path in pathlist: + path_in_str = str(path) + print(path_in_str) + with open(path_in_str) as f: + for line in f: + if pattern.search(line): + print(line) + +for subdir, dirs, files in os.walk(path): + for file in files: + print(os.path.join(subdir, file)) + filepath = subdir + os.sep + file + if filepath.endswith(".lua"): + print(filepath) \ No newline at end of file