Closed angelikatyborska closed 3 years ago
This will be such a satisfying check :)
To inspect all the comments present in the stub but not in the exemplar, you can use
for D in exercises/concept/*; do comm -23 ./$D/lib/**/*.ex ./$D/.meta/exemplar.ex | grep "#"; done
It kind of works on my Mac with zsh (there is noise and it breaks on one or two exercises, but it's enough to get an idea).
Look like a few exercises use # TODO: define the ... function
Any "todo"
remaining in comments could also return a specific message.
I'll work on this one
Most concept exercises have boilerplate code with comments that say "Please implement the xyz/n function". A lot of published solutions still have those comments.
Add a common check for all exercises that will look for this pattern in the string with the solution:
If it finds it, it should return an actionable comment that says something like this:
If you want to be 100% sure that only comments will be found this way and not strings, you can run the check twice - once on the original string, and once on the string turned into the AST and back (see
lib/elixir_analyzer/exercise_test/common_checks/indentation.ex
that does something similar to find tabs used for indentation).This check can either be implemented like
lib/elixir_analyzer/exercise_test/common_checks/indentation.ex
(with arun
function) or likelib/elixir_analyzer/exercise_test/common_checks/debug_functions.ex
with a__using__
macro, using thecheck/check_source
helpers added in https://github.com/exercism/elixir-analyzer/pull/189