def main(): '''Main driver.''' bib_file, chapters = sys.argv[1], sys.argv[2:] defined = get_keys(bib_file) used = read_all_files(chapters, get_references, True) report('Defined but not used', defined - used) report('Used but not defined', used - defined)
def main(gloss_file, source_files): '''Main driver.''' term_def = get_defined_terms(gloss_file) term_used = read_all_files(source_files, find_uses, remove_code=False) report('Undefined terms', term_used - term_def) report('Unused links', term_def - term_used)
def main(links_file, source_files): '''Main driver.''' with open(links_file, 'r') as reader: defined = set(PAT_DEF.findall(reader.read())) used = read_all_files(source_files, find_uses, remove_code=True) report('Links: undefined', used - defined) report('Links: unused', defined - used)
def main(source_files): '''Main driver.''' captions = read_all_files(source_files, find_captions) captions = [c for c in captions if not c.endswith('.')] if captions: for c in captions: print(c)
def main(links_file, gloss_file, source_files): '''Main driver.''' link_def = get_defined_links(links_file) used = read_all_files(source_files, find_uses, remove_code=False) report('Undefined Links', used - link_def) gloss_crossref = get_gloss_crossref(links_file) gloss_def = get_defined_gloss(gloss_file) report('Undefined glossary', gloss_crossref - gloss_def)
def main(links_dir, source_files): '''Main driver.''' defined = set() for suffix in SUFFIXES: defined.update( set( os.path.normpath(p) for p in glob.glob(f'{links_dir}/**/*.{suffix}', recursive=True))) used = read_all_files(source_files, find_uses) report('Links: undefined', used - defined) report('Links: unused', defined - used)
def main(source_files): '''Main driver.''' chunks = read_all_files(source_files, get_chunks) chunks = {c for c in chunks if bad_chunk(c)} report('Bad Chunks', chunks)