INNER CODE UNIT · Python
main
O-X-L/ansible-opnsense · scripts/get_changed_modules.py:47
def main(file_changes: (Path, str), file_out: (Path, str)):
with open(file_changes, 'r', encoding='utf-8') as f:
raw_changes = f.readlines()
changes = []
for p in raw_changes:
p = p.strip()
if p.endswith('.py') and (p.endswith('monit_test.py') or not p.endswith('_test.py')):
changes.append(p)
elif p.startswith('tests/') and p.endswith('.yml'):
changes.append(p)
valid_modules = []
for f in listdir(Path(__file__).parent.parent / 'tests'):
if not f.startswith('1_') and not f == '_tmpl.yml' and not f == 'README.md':
valid_modules.append(f.replace('.yml', ''))