1
0
Fork 0
mirror of https://github.com/iiab/iiab.git synced 2025-02-13 03:32:12 +00:00
iiab/scripts/roles_needing_docs.py

28 lines
808 B
Python
Raw Normal View History

#!/usr/bin/env python3
'''
This script checks every role in the project and prints its name to stdout if
2018-10-09 17:16:45 +00:00
the role directory does not contain a README file and it is not listed in
scripts/docs_ignore.
For ease of use, you can pipe the output of this script to a file or to a
clipboard utility (e.g. pbcopy on macOS, xclip on Linux).
'''
2018-10-09 17:16:45 +00:00
import os
from os.path import join as make_path
from glob import glob
2018-10-09 17:16:45 +00:00
def included_roles():
all_roles = set(os.listdir("roles"))
excluded_roles = \
map(str.rstrip, open(make_path("scripts", "docs_ignore")))
included_roles = list(all_roles.difference(excluded_roles))
included_roles.sort()
return included_roles
for role in included_roles():
readme = make_path("roles", role, "README.*")
if not glob(readme):
print(role)