Skip to content
New issue

Have a question about this project? Sign up for a free GitHub account to open an issue and contact its maintainers and the community.

By clicking “Sign up for GitHub”, you agree to our terms of service and privacy statement. We’ll occasionally send you account related emails.

Already on GitHub? Sign in to your account

Document best practices for testing script-based styles #734

Open
1 task done
ptgott opened this issue Dec 1, 2023 · 0 comments
Open
1 task done

Document best practices for testing script-based styles #734

ptgott opened this issue Dec 1, 2023 · 0 comments

Comments

@ptgott
Copy link
Contributor

ptgott commented Dec 1, 2023

Check for existing issues

  • Completed

Describe the feature

I am currently evaluating Vale as a prose linting solution, and noticed that the script extension point allows organizations to enforce style rules that do not correspond with one of the other extension points.

I was hoping the Vale docs could describe the intended best practice for testing Tengo scripts included in script-based rules. When writing linters for prose, I would want to account for edge cases and, when accommodating new ones, prevent regressions, and I'm guessing it will be a lot easier to write script-based rules with a test suite.

From the current docs, it looks like there's no Vale-native way to import script scripts into a test runner to execute against minimal inputs. I guess it's possible to use a custom approach. For example, a project could store Tengo files separately from the Vale config. This way, the project could have a Tengo test runner load these files for testing. Then a script could insert the Tengo files into their associated Vale configurations. This seems a little complicated, though, so it be nice to know if there is a recommended way to test script scripts!

Sign up for free to join this conversation on GitHub. Already have an account? Sign in to comment
Projects
None yet
Development

No branches or pull requests

1 participant