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

Use Vale to lint docs writing #739

Merged
merged 6 commits into from
Mar 7, 2023
Merged

Use Vale to lint docs writing #739

merged 6 commits into from
Mar 7, 2023

Conversation

frankharkins
Copy link
Member

@frankharkins frankharkins commented Mar 6, 2023

Summary

Uses Vale to lint writing in the docs. The most notable impact is the ability to catch spelling errors during CI, but this tool can also help enforce writing style rules.

To try it, install Vale and run

make docs-test

(you may also need to pip install docutils if you don't have it already).

Most developers should be able to ignore this test (that is, no need to install Vale), and should only be impacted if a documentation change introduces an error, which is usually easily fixable.

Details and comments

The rules used are from IBM/ibm-quantum-style-guide.

Similar to pylint, you can turn off rules for specific sections using comments. Please make an issue if a rule is not working correctly so we can improve it.

How to read this PR

I've split this into three separate commits to make review easier:

  • caab66a adds the ability to use Vale to lint the docs
  • 0269ef6 edits the docs to adhere to the linter
  • 10db466 adds a linting test to the CI (will error on spelling mistakes and latin abbreviations)
  • (Unrelated to this PR) 16752f3 runs black on the notebooks so the CI no longer fails

In collaboration with @beckykd.

@review-notebook-app
Copy link

Check out this pull request on  ReviewNB

See visual diffs & provide feedback on Jupyter Notebooks.


Powered by ReviewNB

@frankharkins frankharkins requested review from kt474 and beckykd and removed request for kt474 March 6, 2023 16:58
@coveralls
Copy link

coveralls commented Mar 6, 2023

Pull Request Test Coverage Report for Build 4353319540

  • 0 of 0 changed or added relevant lines in 0 files are covered.
  • No unchanged relevant lines lost coverage.
  • Overall coverage remained the same at 66.775%

Totals Coverage Status
Change from base Build 4317042055: 0.0%
Covered Lines: 3298
Relevant Lines: 4939

💛 - Coveralls

.github/workflows/ci.yml Outdated Show resolved Hide resolved
@frankharkins frankharkins requested a review from kt474 March 7, 2023 12:09
Copy link
Member

@kt474 kt474 left a comment

Choose a reason for hiding this comment

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

Looks good on my end - If @beckykd is on board with these changes, we can merge

Copy link
Collaborator

@beckykd beckykd left a comment

Choose a reason for hiding this comment

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

Excited to add this process!

@kt474 kt474 merged commit 8b08753 into Qiskit:main Mar 7, 2023
@frankharkins frankharkins deleted the fh-vale branch March 7, 2023 19:47
kt474 pushed a commit that referenced this pull request May 10, 2023
* Add writing linting with Vale

* Lint docs using Vale rules

Co-authored-by: Rebecca Dimock <[email protected]>

* Add Vale tests to CI

* Run black code formatting

* Remove unneeded echo statements

* Update PATH

---------

Co-authored-by: Rebecca Dimock <[email protected]>
Eric-Arellano pushed a commit to Qiskit/documentation that referenced this pull request Oct 6, 2023
* Add writing linting with Vale

* Lint docs using Vale rules

Co-authored-by: Rebecca Dimock <[email protected]>

* Add Vale tests to CI

* Run black code formatting

* Remove unneeded echo statements

* Update PATH

---------

Co-authored-by: Rebecca Dimock <[email protected]>
Eric-Arellano pushed a commit to Qiskit/documentation that referenced this pull request Oct 9, 2023
* Add writing linting with Vale

* Lint docs using Vale rules

Co-authored-by: Rebecca Dimock <[email protected]>

* Add Vale tests to CI

* Run black code formatting

* Remove unneeded echo statements

* Update PATH

---------

Co-authored-by: Rebecca Dimock <[email protected]>
Sign up for free to join this conversation on GitHub. Already have an account? Sign in to comment
Labels
None yet
Projects
None yet
Development

Successfully merging this pull request may close these issues.

4 participants