diff options
| -rw-r--r-- | src/dev/check.rs | 10 |
1 files changed, 10 insertions, 0 deletions
diff --git a/src/dev/check.rs b/src/dev/check.rs index 2c48f0e..3cb5345 100644 --- a/src/dev/check.rs +++ b/src/dev/check.rs @@ -19,6 +19,9 @@ fn check_info_file_exercises(info_file: &InfoFile) -> Result<hashbrown::HashSet< let mut paths = hashbrown::HashSet::with_capacity(info_file.exercises.len()); for exercise_info in &info_file.exercises { + if exercise_info.name.is_empty() { + bail!("Found an empty exercise name in `info.toml`"); + } if let Some(c) = forbidden_char(&exercise_info.name) { bail!( "Char `{c}` in the exercise name `{}` is not allowed", @@ -27,11 +30,18 @@ fn check_info_file_exercises(info_file: &InfoFile) -> Result<hashbrown::HashSet< } if let Some(dir) = &exercise_info.dir { + if dir.is_empty() { + bail!("Found an empty dir name in `info.toml`"); + } if let Some(c) = forbidden_char(dir) { bail!("Char `{c}` in the exercise dir `{dir}` is not allowed"); } } + if exercise_info.hint.is_empty() { + bail!("The exercise `{}` has an empty hint. Please provide a hint or at least tell the user why a hint isn't needed for this exercise", exercise_info.name); + } + if !names.insert(exercise_info.name.as_str()) { bail!( "The exercise name {} is duplicated. Exercise names must all be unique", |
