errata-ai / vale

:pencil: A markup-aware linter for prose built with speed and extensibility in mind.
https://vale.sh
MIT License
4.52k stars 155 forks source link

feat: Allow users to override comment delimiters #900

Closed ptgott closed 1 month ago

ptgott commented 2 months ago

Allow users to specify the comment delimiters they are using in their documentation. vale replaces these with HTML comment tags before linting, making it possible to control style rules for specific passages of prose in file formats that use non-HTML comment syntax. This is critical for controlling style rules within a page in MDX, and potentially other formats as well.

This example configures the CommentDelimiters field for *.md files, indicating that {/* and */} are the custom comment delimiters:

[*.md]
CommentDelimiters = "{/*,*/}"

Internally, custom delimiters are represented as a [2]string, and it is only possible to configure one set of custom comment delimiters for a given format block.

More specific changes:

Closes #762

ptgott commented 1 month ago

Hello @jdkato, it looks like a number of cucumber tests are failing in CI. When I set up a development environment per the instructions and run make test on origin/v3, cucumber tests also fail. Is this a known issue? Is there a way to verify which failures were introduced by my changes? Thanks!

jdkato commented 1 month ago

The tests pass on the v3 branch on GitHub and for me locally.

So my guess is that the failures you're seeing locally on the v3 branch are related to your environment, but I would need to know which cases are failing to say more.

The failures here are related to your changes, but I haven't looked closely enough to say exactly why.

My advice would be to try running Vale in the relevant test directories, starting with testdata/fixtures/patterns.

ptgott commented 1 month ago

@jdkato Thanks for your help! I realized why my changes were introducing failures and pushed a fix with a new unit test.

jdkato commented 1 month ago

The changes look good. Are you ready for this to be merged?

ptgott commented 1 month ago

The changes look good. Are you ready for this to be merged?

Yes, thanks for taking a look and helping me through the process!