tbroadley / spellchecker-cli

A command-line tool for spellchecking files.
MIT License
119 stars 16 forks source link

Add spellchecker-disable/spellchecker-enable inline comment #61

Closed xoxys closed 4 years ago

xoxys commented 4 years ago

Fixes #42.

Add a regex to remove blocks surrounded by <!-- spellchecker-disable --> and <!-- spellchecker-enable --> before spellchecking.

xoxys commented 4 years ago

Here you go. Let me know what you think :)

tbroadley commented 4 years ago

Thanks for this! The code looks good. Would you be able to write a test or two for the feature?

xoxys commented 4 years ago

Sure I could try. To be honest I'm not really familiar with NodeJS.

tbroadley commented 4 years ago

That's fair. If you feel like trying that'd be great. If not, I can look at adding tests this weekend.

To test this, I'd suggest adding a couple of Markdown file fixtures to the test/fixtures folder, then adding test cases that use those fixtures to test/cli-test.js. The test cases would be pretty similar to the existing test cases, which test that the spellchecker command prints an error and returns an error status code, or that it doesn't. Let me know if I can provide any more guidance.

xoxys commented 4 years ago

Ah cool, that are some useful information to get started :) Let me give it a try.

xoxys commented 4 years ago

Ok I've added some test cases. @tbroadley please review.

tbroadley commented 4 years ago

I just published v4.4.0 with this change.