Files
red-valley/_find_broken.py

25 lines
761 B
Python
Raw Normal View History

import re
path = r'E:\FiveMserver\server\resources\[framework]\[core]\qb-core\shared\items.lua'
with open(path, 'r', encoding='utf-8', errors='ignore') as f:
lines = f.readlines()
broken = []
for i, line in enumerate(lines):
stripped = line.strip()
if "['description']" not in stripped:
continue
if "['name']" not in stripped:
continue
# Count single quotes after ['description']
idx = stripped.index("['description']")
after = stripped[idx:]
# Should end with ...'}, or ...'}},
# Check if description value has matching quotes
if after.count("'") % 2 != 0:
broken.append((i+1, stripped[:120]))
print(f"Found {len(broken)} broken strings:")
for ln, txt in broken:
print(f" L{ln}: {txt}")