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
Add Vale to Travis CI #147
Conversation
This is super neat and interesting! Thanks for taking the time to set it up. I'm definitely interested in adopting it, and will go through and try to fix the errors :) |
@ericholscher leave the fixup to me if you like. |
Works for me! :) |
OK, I'm picking this up, a few days late. @jdkato many thanks for this work. A couple of thoughts:
I'd have some preference for running only error linters on a default build, not warnings, to reduce noise, and asking people to run those locally but I doubt that is actually practical, and definitely outside the scope of this PR for now. |
mmmm, not quite sure why the build now can't find @jdkato if you cherrypick that commit into your branch it should fix the 9 errors that the build flagged |
Hi @plaindocs, Sorry, I've recently restructured the project so that it works as a Go library in addition to a CLI tool. This changes the |
I've fixed the With regard to your previous comment,
Creating a new check (or "rule" in Vale terminology) is simply a matter of writing a YAML file that extends one of Vale's built-in checks and adding it to a style (e.g., the WTD style I made for this PR). For example, # GenderBias.yml
type: substitution # the type of check we're extending.
message: Consider using '%s' instead of '%s'
# ^ What we display to the user.
ignorecase: true
level: error # the severity level
map:
man enough: strong enough
mankind: human kind In this case, we would flag any occurrences of "man enough" or "mankind." An example message would be:
(You can see a more thorough example here.)
I'd summarize Vale's pros and cons as follows:
If you'd like me to make a more thorough example WTD style for you to compare against other linters, just let me know. I'd gladly use the opportunity to test the extension system.
This can be set via the |
Thanks for the detailed reply @jdkato ! My concern here is that I don't want to hugely increase friction to additions / edits to the docs by failing the build on (imho) trivial things like I'd like a small subset of important things to fail the build, such as discriminatory language, the RTD/WTD branding issue. But that list is open for discussion, and definitely looks like it should be easily doable with vale. I think the important thing generally is an easy to implement linter with sensible defaults so that people can drop in a linter that checks for BAD THINGS (TM) but does not enforce a style in an Economost / Chicago Manual of Style type way - so people can select that themselves. And I think that kind of sensible defaults is something I'd be happy to help with, and would be very useful for many documentarians around these parts. So, I think the way forward is to start with a small list of checks, merge this in once we have them and build on that. Can we brainstorm a list of checks we want to fail the build in a separate issue #157 , and I'll take care of implementing them into vale yaml, with help from @jdkato . |
This looks good to me as is. I'll let @plaindocs merge it since he has more context, but I'd like to get this in, since it is a bit more robust than the current version :) |
I'm working on this, and will try to merge it in asap. Current issues, hoping @jdkato can help:
|
Some config changes: 22541ce |
You can currently only specify what you want to lint using the
Vale only includes the rules in the
Not yet ... but it's on my TODO list (errata-ai/vale#18).
I'll take a look.
Yeah, to be honest, I overestimated Vale's robustness (sorry!) at handling markup when I opened this PR. You may want to wait for the resolution of errata-ai/vale#19 before moving forward. I made progress on it this weekend, but it's still not ready. |
Thanks for the answers! I'll see if I can tweak the config docs to make the Style guide thing more clear. Yeah, I guess we'll hold off a little and see how things go. I've tracked both those issues. If we can implement an exclude file/directory mechanism then we could probably merge this in even if the html parsing isn't perfect - by ignoring the file with the issue. |
I checked this out and it was my fault: errata-ai/vale@0fe6389 split up the check extension points and changed some of the field names, but I forgot to change "type" to "extends" when I updated my fork in https://github.com/jdkato/www/commit/abf28106ac225bc7c4f662ed9297612621b929ab. I fixed my fork and I'm also going to work on adding better error reporting when Vale fails to load rule.
I was thinking about just adding a |
|
Cheers for the fixup. :-) I think as soon as that |
I should have the I've also improved markup parsing (I discussed the technique at errata-ai/vale#19). I'm sure it's stil not perfect, but the issues with embedded HTML appear to be fixed. |
Since Vale now uses rst2html to process reStructuredText, it needs access to docutils (which is a dependency of Sphinx).
Instead of duplicating the functionality of # The "!" negates the glob, so this will ignore the `_build` directory
$ vale --glob='!*/_build/*' docs |
Hi,
This PR adds Vale to your existing Travis CI setup (and replaces
test-branding.py
). I made a post about Vale on the WTD forum.I don't necessarily expect this to be merged; I just thought you might be interested in seeing how it could be used (it's also relevant to #58).
In terms of the actual linting, I implemented some of the ideas discussed in the December 2016 newsletter:
The build will only fail on errors (it's currently failing over the use of "Read The Docs" in
origin-story.rst
and a number of different forms of "e.g." throughout the docs). Obviously, you may want to tweak the individual checks yourselves.Thanks for taking a look!