Skip to content

Add vale linter bot #7126

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

Closed
wants to merge 2 commits into from
Closed

Conversation

santos22
Copy link
Contributor

@santos22 santos22 commented May 26, 2020

Fixes #5876

😄 I was inspired by the following projects since they had vale set up:

TODO:

  • Fix incorrect usages of "Read the Docs"
  • Fix legacy misspelling
  • Fix can can repetition

@santos22
Copy link
Contributor Author

Interesting. The new build job should've failed like it did locally.

Screen Shot 2020-05-25 at 8 36 14 PM

@santos22
Copy link
Contributor Author

santos22 commented May 26, 2020

Build is now failing! Can follow-up and fix the incorrect usages of "Read the Docs" after someone sees this to confirm that it does work 👍

https://travis-ci.org/github/readthedocs/readthedocs.org/jobs/691165858

@santos22
Copy link
Contributor Author

santos22 commented May 26, 2020

The following can be added to .vale.ini.

Vale.Spelling = YES
Vale.Repetition = YES

I've attached some screenshots on what this looks like but did not include in this pull request. There's some weirdness with the Spelling rule where it doesn't recognize terms like MkDocs, Conda, etc. Looks like we can add an text file with terms to ignore (https://errata-ai.github.io/vale/styles/#spelling).

The errors for repetition are because of reStructuredText headings and that same word coming right after. There was a valid repetition caught that can be fixed as part of this PR.

Spelling

Screen Shot 2020-05-25 at 9 13 21 PM

Repetition

Screen Shot 2020-05-25 at 9 12 48 PM

For most Python dependencies, you can can specify a requirements file...

Source: https://github.com/readthedocs/readthedocs.org/blob/master/docs/faq.rst#my-documentation-requires-additional-dependencies

@santos22
Copy link
Contributor Author

santos22 commented Jun 1, 2020

Thoughts @humitos @stsewd?

Copy link
Member

@ericholscher ericholscher left a comment

Choose a reason for hiding this comment

The reason will be displayed to describe this comment to others. Learn more.

This seems useful, if it doesn't add too much time to our builds. Our CI is already really slow, but I could see this being useful for our docs.

level: error
swap:
Read The Docs: Read the Docs
RTD: Read the Docs
Copy link
Member

Choose a reason for hiding this comment

The reason will be displayed to describe this comment to others. Learn more.

I think we want to enable this usage in some places, but the above rule makes sense to me.

Copy link
Contributor Author

@santos22 santos22 Jun 23, 2020

Choose a reason for hiding this comment

The reason will be displayed to describe this comment to others. Learn more.

It looks like we can disable and enable with the following markup comments:

Read The Docs

.. vale off

Read The Docs

.. vale on

Read The Docs

So in that example, an error would be thrown for text before .. vale off and for text after .. vale on.

Source: https://errata-ai.gitbook.io/vale/getting-started/markup#restructuredtext

@santos22
Copy link
Contributor Author

santos22 commented Aug 6, 2020

If the linter is not needed at this point in time, I can re-purpose this PR to fix the incorrect usages of "Read the Docs" and the spelling and repetition errors.

@stale
Copy link

stale bot commented Sep 20, 2020

This issue has been automatically marked as stale because it has not had recent activity. It will be closed if no further activity occurs. Thank you for your contributions.

@stale stale bot added the Status: stale Issue will be considered inactive soon label Sep 20, 2020
@stale stale bot closed this Sep 28, 2020
Sign up for free to join this conversation on GitHub. Already have an account? Sign in to comment
Labels
Status: stale Issue will be considered inactive soon
Projects
None yet
Development

Successfully merging this pull request may close these issues.

Setup vale linter bot
2 participants