3mdeb / hooks

MIT License
2 stars 0 forks source link

namespell: Ignore text inside code blocks #14

Closed PLangowski closed 3 days ago

PLangowski commented 1 month ago

The changes have been tested on meta-dts

m-iwanicki commented 1 month ago

I think you need some test files to make sure namespell works as intended and there are no regressions.

Not sure if you can disable rule on next line as it's usually done in other checkers e.g.

(...)
# namespell:disable
disable only this line
(...)

This file should probably show no errors: no_errors.md

Currently:

PLangowski commented 3 weeks ago

@m-iwanicki code blocks shouldn't contain triple backticks, that's why i didn't add support for this. If you delete them form line 19, then namespell only shows errors with inline code.

m-iwanicki commented 3 weeks ago

@PLangowski Are you sure?


Or

Or

-```



Each block is formatted and displayed correctly by GitHub or other markdown parsers. Your code will silently fail in this case and it'd be very hard to know it isn't working correctly.
I'm saying all this because I'd want this hook to be more widely used but in current state it faces opposition to wider adoption.
PLangowski commented 3 weeks ago

For now I was able to implement ignoring inline code/comments 48dffcb9a61f3393efec94566980a8ff2abf1674

PLangowski commented 1 week ago

@m-iwanicki The cases you've presented are quite difficult to implement, and aren't that widely used. I agree that they're valid, but maybe we could track them in another issue and try to implement them in the future?

m-iwanicki commented 1 week ago

@PLangowski I guess that's ok.

PLangowski commented 1 week ago

Can we merge this then?

m-iwanicki commented 1 week ago

Looks ok, but fix pre-commit failures before merging

PLangowski commented 1 week ago

@m-iwanicki done