vhf / free-programming-books-lint

A rudimentary Markdown linter based on remark-lint for the free-programming-books project.
32 stars 12 forks source link

feat: allow multiple directories #29

Closed SethFalco closed 1 year ago

SethFalco commented 3 years ago

Currently, we're running the fpb-lint command 4 times to test each directory.

This change makes the command take a list of directories instead of just 1. After this, we can update free-programming-books from having 4 separate run steps to just:

- - run: fpb-lint ./books/
- - run: fpb-lint ./casts/
- - run: fpb-lint ./courses/
- - run: fpb-lint ./more/
+ - run: fpb-lint ./books/ ./casts/ ./courses/ ./more/

The motivation is to collate the linting to a single process, output, and exit code. This will make it simpler later when/if we make more use of the output, like suggesting fixes and automatic suggestions on GitHub.

By merging the 4 runs into 1, this also incidentally addresses an issue we have with GitHub Actions where the build fails early. If warnings were displayed in ./books/, it would fail and stop linting further files. This means there could be more warnings in ./casts/ but the contributor wouldn't know until after fixing the warnings from ./books/.


I added Commander as a dependency for 2 reasons:

vhf commented 1 year ago

Merged and release 6f39fdb9d2bba578077ff618d1cd77659885ff14