Coverage for glotter/check.py: 100%

13 statements  

« prev     ^ index     » next       coverage.py v7.6.12, created at 2025-04-12 02:25 +0000

1import sys 

2 

3from glotter.source import get_sources, BAD_SOURCES 

4from glotter.settings import Settings 

5 

6 

7def check(_args): 

8 # Get all sources 

9 all_sources = get_sources(Settings().source_root, check_bad_sources=True) 

10 

11 # If no bad sources, exit with zero status 

12 bad_sources = all_sources[BAD_SOURCES] 

13 if not bad_sources: 

14 print("All filenames correspond to valid projects") 

15 sys.exit(0) 

16 

17 # Show bad sources and exit with non-zero status 

18 print("The following filenames do not correspond to a valid project:") 

19 for source in sorted(bad_sources): 

20 print(f"- {source}") 

21 

22 sys.exit(1)