Fix script-docs.py extension check

The check previously matched any filename ending in `lua`, not `.lua`. This
caused failures in my fork because I had a branch ending in `-lua`, which
created a file of that name in `.git/refs` that was not a valid Lua script.

For extra good measure, anything under `.git` is ignored now as well.
develop
lethosor 2022-05-11 01:06:47 -04:00
parent 7439678214
commit 8696f72f77
No known key found for this signature in database
GPG Key ID: 76A269552F4F58C1
1 changed files with 2 additions and 2 deletions

@ -81,11 +81,11 @@ def check_file(fname):
def main():
"""Check that all DFHack scripts include documentation"""
err = 0
exclude = set(['internal', 'test'])
exclude = {'.git', 'internal', 'test'}
for root, dirs, files in os.walk(SCRIPT_PATH, topdown=True):
dirs[:] = [d for d in dirs if d not in exclude]
for f in files:
if f[-3:] in {'.rb', 'lua'}:
if f.split('.')[-1] in {'rb', 'lua'}:
err += check_file(join(root, f))
return err