From 4df505249a27191c3475102cde4c150b0a131102 Mon Sep 17 00:00:00 2001 From: Maxim Belkin Date: Wed, 14 Apr 2021 00:42:49 -0500 Subject: [PATCH] Don't check links.md in lessons that use remote theme Fixes carpentries/styles#570 --- bin/lesson_check.py | 12 ++++++++++-- 1 file changed, 10 insertions(+), 2 deletions(-) diff --git a/bin/lesson_check.py b/bin/lesson_check.py index 74d50549..249464fd 100644 --- a/bin/lesson_check.py +++ b/bin/lesson_check.py @@ -113,7 +113,10 @@ def main(): if life_cycle == "pre-alpha": args.permissive = True check_source_rmd(args.reporter, args.source_dir, args.parser) - args.references = read_references(args.reporter, args.reference_path) + + args.references = {} + if not using_remote_theme(): + args.references = read_references(args.reporter, args.reference_path) docs = read_all_markdown(args.source_dir, args.parser) check_fileset(args.source_dir, args.reporter, list(docs.keys())) @@ -167,6 +170,10 @@ def parse_args(): return args +def using_remote_theme(): + config_file = os.path.join(source_dir, '_config.yml') + config = load_yaml(config_file) + return 'remote_theme' in config def check_config(reporter, source_dir): """Check configuration file.""" @@ -493,7 +500,8 @@ def check(self): """Run extra tests.""" super().check() - self.check_reference_inclusion() + if not using_remote_theme(): + self.check_reference_inclusion() def check_metadata(self): super().check_metadata()