mirror of
https://git.minetest.land/VoxeLibre/VoxeLibre.git
synced 2024-11-16 16:11:06 +01:00
Basic not working script
This commit is contained in:
parent
0867d6e406
commit
72e53a82d7
1 changed files with 22 additions and 0 deletions
22
tools/create_luacheck.py
Normal file → Executable file
22
tools/create_luacheck.py
Normal file → Executable file
|
@ -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)
|
Loading…
Reference in a new issue