Skip to content

Commit d0aceb3

Browse files
authored
Merge pull request carpentries/styles#614
lesson_check.py: fix error message for the 'defaults' check
2 parents 092e5c9 + 8498d31 commit d0aceb3

File tree

1 file changed

+8
-3
lines changed

1 file changed

+8
-3
lines changed

bin/lesson_check.py

Lines changed: 8 additions & 3 deletions
Original file line numberDiff line numberDiff line change
@@ -218,9 +218,14 @@ def check_config(reporter, source_dir):
218218
{'values': {'root': '..', 'layout': 'episode'}, 'scope': {'type': 'episodes', 'path': ''}},
219219
{'values': {'root': '..', 'layout': 'page'}, 'scope': {'type': 'extras', 'path': ''}}
220220
]:
221-
reporter.check(defaults in config.get('defaults', []),
222-
'configuration',
223-
'"root" not set to "." in configuration')
221+
error_text = 'incorrect settings for: root "{0}" layout "{1}"'
222+
root = defaults["values"]["root"]
223+
layout = defaults["values"]["layout"]
224+
error_message = error_text.format(root, layout)
225+
226+
defaults_test = defaults in config.get('defaults', [])
227+
reporter.check(defaults_test, 'configuration', error_message)
228+
224229
if 'life_cycle' not in config:
225230
config['life_cycle'] = None
226231
return config['life_cycle']

0 commit comments

Comments
 (0)