Open tejasbubane opened 6 years ago
@tejasbubane thanks for the feedback. We wanted to try an avoid having additional checks for determining if a slug is an actual exercise as the non-core check would account for thst problem. But I do see the reasoning around including the exercise name, especially “null”.
Would you be open to messaging like the one below?
The exercise ‘exercise-slug’ is being unlocked by ‘other-exercise-slug’, which is not core. Non-core exercises can only be unlocked by core track exercises
@nywilken, something worth noting about this error message is that I wanted to include the non-core unlocked_by name, but the check
function that all the lint functions use has a signature of func(track.Track) []string
here. I did not want to go changing the signature and working outside the linter's pattern, despite me agreeing with @tejasbubane that a better message can be achieved.
I thought I'd drop this here so that it can be discussed and a possible solution found.
One thing we might be able to do is have an error message function for each lint function that takes the slug of the exercise, and then can do extra work if necessary to put together a useful error message, if that makes sense (I haven't actually looked at the code recently, and this might be hard to do).
In the javascript track config,
collatz-conjecture
exercise hasunlocked_by
set to"null"
- which is not an exercise.The error message shown is:
This could be improved to tell that
"null" is not an exercise
. Can be also useful in case of typos in the exercise slug.