carpentries / styles

Styles for The Carpentries lessons. No README to avoid merge conflicts with lessons. Demo 👇
https://carpentries.github.io/lesson-example
Other
84 stars 94 forks source link

Improve `make lesson-check` output #611

Open kekoziar opened 2 years ago

kekoziar commented 2 years ago

When I run make lesson-check there is no output- it just finishes running and presents a command prompt. I can only guess there are no errors in the lesson. To test this, I introduced errors. Sometimes it produced an error (when I deleted required files); sometimes not (when I introduced line-length errors).

I recommend that make lesson-check always has output, including an explicit statement that the items checked in the lesson are without structural error. Perhaps include a list of what was checked.

maxim-belkin commented 2 years ago

I think this is a good suggestion. Would something like this work for you?

$ make lesson-check
==> Checking confguration file (_config.yml)
==> Ensure that Rmd episode files include `source: Rmd`
==> Reading file with shared references (_includes/links.md)
==> Reading all Markdown files
==> Checking for required and extraneous files
==> Checking that there are no unwanted files
==> Checking file: ./CODE_OF_CONDUCT.md
==> Checking file: ./aio.md
==> Checking file: ./LICENSE.md
==> Checking file: ./reference.md
==> Checking file: ./setup.md
==> Checking file: ./README.md
==> Checking file: ./index.md
==> Checking file: ./CONTRIBUTING.md
==> Checking file: ./404.md
==> Checking file: ./_episodes/04-lists.md
==> Checking file: ./_episodes/11-debugging.md
==> Checking file: ./_episodes/01-intro.md
==> Checking file: ./_episodes/03-matplotlib.md
==> Checking file: ./_episodes/02-numpy.md
==> Checking file: ./_episodes/10-defensive.md
==> Checking file: ./_episodes/08-func.md
==> Checking file: ./_episodes/12-cmdline.md
==> Checking file: ./_episodes/06-files.md
==> Checking file: ./_episodes/07-cond.md
==> Checking file: ./_episodes/09-errors.md
==> Checking file: ./_episodes/05-loop.md
==> Checking file: ./_extras/figures.md
==> Checking file: ./_extras/additional_material.md
==> Checking file: ./_extras/discuss.md
==> Checking file: ./_extras/guide.md
==> Checking file: ./_extras/extra_exercises.md
==> Checking file: ./_extras/about.md
kekoziar commented 2 years ago

If the error messages are listed under each file/check, I think that would be okay. My preference is still with a "No errors found" message at the end if there are no issues. But, at least with the proposed output, a user would know it's doing something. Thanks!

maxim-belkin commented 2 years ago

I've discovered several bugs in lesson-check.py while working on this, so thank you for creating this issue, @kekoziar!