-
Notifications
You must be signed in to change notification settings - Fork 84
Check the syntax of reStructuredText files during CI #112
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
Merged
Merged
Changes from all commits
Commits
Show all changes
17 commits
Select commit
Hold shift + click to select a range
6dd7a08
Adding a GitHub CI workflow to check the syntax of reStructuredText f…
rptb1 646436a
Suppress Travis CI on branch/2023-01-13/rst-check for faster testing …
rptb1 79fb554
Run checking steps even if other steps fail.
rptb1 a1c003d
Moving checking to its own script so it can be used at the command li…
rptb1 db63baf
Refining pruning rules for command-line use.
rptb1 5da9822
Fixing basic reStructuredText syntax and reference errors found by to…
rptb1 83c1230
Improving the naming so that results are clearer in GitHub output.
rptb1 b2ae297
Fixing warnings found by shellcheck.
rptb1 caa7a60
Fixing duplicate tag design.mps.config.var introduced in commit 533f4…
rptb1 1a1d265
Oops, forgot to fix up the RST ref in commit caa7a60
rptb1 d5d996d
Fixing duplicate tags introduced by e9841d23a0 as a consequence of b0…
rptb1 b8d1851
Fixing duplicate tag design.mps.arena.tract.field.base. Looks like a…
rptb1 dd6493a
Fixing duplicate tag design.mps.prmc.if.init.thread. Looks like a co…
rptb1 21ac667
Making script name more readable.
rptb1 2fb85a4
Enabling manual triggering of reStructuredText syntax check.
rptb1 15b3d00
Clarifying that this checks the MPS source tree, not the MPS. Signing.
rptb1 7c6b6aa
Linking comment about smushed document to GitHub issue 128 <https://g…
rptb1 File filter
Filter by extension
Conversations
Failed to load comments.
Loading
Jump to
Jump to file
Failed to load files.
Loading
Diff view
Diff view
There are no files selected for viewing
This file contains hidden or bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
| Original file line number | Diff line number | Diff line change |
|---|---|---|
| @@ -0,0 +1,23 @@ | ||
| # .github/workflows/rst-check.yml -- check syntax of reStructuredText files | ||
| # | ||
| # This is a GitHub CI workflow | ||
| # <https://docs.github.com/en/actions/using-workflows/about-workflows> | ||
| # to check the syntax of reStructuredText files. | ||
|
|
||
| name: reStructuredText syntax check | ||
|
|
||
| on: | ||
| # Run as part of CI checks on branch push and on merged pull request. | ||
| - push | ||
| - pull_request | ||
| - workflow_dispatch # allow manual triggering | ||
|
|
||
| jobs: | ||
| check-rst: | ||
| runs-on: ubuntu-latest | ||
| steps: | ||
| - uses: actions/checkout@v3 | ||
| - name: Install docutils | ||
| run: sudo apt-get install -y docutils | ||
| - name: Check reStructuredText syntax | ||
| run: tool/check-rst |
This file contains hidden or bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
This file contains hidden or bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
This file contains hidden or bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
This file contains hidden or bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
This file contains hidden or bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
This file contains hidden or bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
This file contains hidden or bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
This file contains hidden or bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
This file contains hidden or bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
This file contains hidden or bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
This file contains hidden or bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
This file contains hidden or bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
| Original file line number | Diff line number | Diff line change |
|---|---|---|
| @@ -0,0 +1,77 @@ | ||
| #!/bin/sh | ||
| # tool/check-rst -- check syntax of reStructuredText in the MPS source tree | ||
| # Richard Brooksby, Ravenbrook Limited, 2023-01-13 | ||
| # | ||
| # Copyright (c) 2023 Ravenbrook Limited. See end of file for license. | ||
| # | ||
| # This script finds reStructuredText files in the MPS tree and runs | ||
| # them through docutils to check for syntax errors. | ||
| # | ||
| # It can be invoked from the command line of from Continuous | ||
| # Integration scripts. See .github/workflows/rst-check.yml | ||
| # | ||
| # This script excludes manual/source because the reStructuredText | ||
| # there is in an extended Sphinx format that can't be checked by the | ||
| # basic docutils. It can be checked by building the manual. See | ||
| # manual/Makefile. | ||
|
|
||
| { | ||
| find . -path ./manual/source -prune -o \ | ||
| -path ./manual/tool -prune -o \ | ||
| -type f -name '*.rst' -print | ||
| find . -type f -name '*.txt' -print | | ||
| while read -r f; do | ||
| if head -1 -- "$f" | grep -F -q -e '-*- rst -*-'; then | ||
| echo "$f" | ||
| fi | ||
| done | ||
| } | { | ||
| code=0 | ||
| while read -r f; do | ||
| if ! rst2html --report=2 --exit-status=2 "$f" > /dev/null; then | ||
| code=1 | ||
| fi | ||
| done | ||
| exit "$code" | ||
| } | ||
|
|
||
| # A. REFERENCES | ||
| # | ||
| # [None] | ||
| # | ||
| # | ||
| # B. DOCUMENT HISTORY | ||
| # | ||
| # 2023-01-13 RB Created. | ||
| # | ||
| # | ||
| # C. COPYRIGHT AND LICENSE | ||
| # | ||
| # Copyright (C) 2023 Ravenbrook Limited <https://www.ravenbrook.com/>. | ||
| # | ||
| # Redistribution and use in source and binary forms, with or without | ||
| # modification, are permitted provided that the following conditions are | ||
| # met: | ||
| # | ||
| # 1. Redistributions of source code must retain the above copyright | ||
| # notice, this list of conditions and the following disclaimer. | ||
| # | ||
| # 2. Redistributions in binary form must reproduce the above copyright | ||
| # notice, this list of conditions and the following disclaimer in the | ||
| # documentation and/or other materials provided with the | ||
| # distribution. | ||
| # | ||
| # THIS SOFTWARE IS PROVIDED BY THE COPYRIGHT HOLDERS AND CONTRIBUTORS "AS | ||
| # IS" AND ANY EXPRESS OR IMPLIED WARRANTIES, INCLUDING, BUT NOT LIMITED | ||
| # TO, THE IMPLIED WARRANTIES OF MERCHANTABILITY AND FITNESS FOR A | ||
| # PARTICULAR PURPOSE ARE DISCLAIMED. IN NO EVENT SHALL THE COPYRIGHT | ||
| # HOLDER OR CONTRIBUTORS BE LIABLE FOR ANY DIRECT, INDIRECT, INCIDENTAL, | ||
| # SPECIAL, EXEMPLARY, OR CONSEQUENTIAL DAMAGES (INCLUDING, BUT NOT | ||
| # LIMITED TO, PROCUREMENT OF SUBSTITUTE GOODS OR SERVICES; LOSS OF USE, | ||
| # DATA, OR PROFITS; OR BUSINESS INTERRUPTION) HOWEVER CAUSED AND ON ANY | ||
| # THEORY OF LIABILITY, WHETHER IN CONTRACT, STRICT LIABILITY, OR TORT | ||
| # (INCLUDING NEGLIGENCE OR OTHERWISE) ARISING IN ANY WAY OUT OF THE USE | ||
| # OF THIS SOFTWARE, EVEN IF ADVISED OF THE POSSIBILITY OF SUCH DAMAGE. | ||
| # | ||
| # | ||
| # $Id$ |
Add this suggestion to a batch that can be applied as a single commit.
This suggestion is invalid because no changes were made to the code.
Suggestions cannot be applied while the pull request is closed.
Suggestions cannot be applied while viewing a subset of changes.
Only one suggestion per line can be applied in a batch.
Add this suggestion to a batch that can be applied as a single commit.
Applying suggestions on deleted lines is not supported.
You must change the existing code in this line in order to create a valid suggestion.
Outdated suggestions cannot be applied.
This suggestion has been applied or marked resolved.
Suggestions cannot be applied from pending reviews.
Suggestions cannot be applied on multi-line comments.
Suggestions cannot be applied while the pull request is queued to merge.
Suggestion cannot be applied right now. Please check back later.
Uh oh!
There was an error while loading. Please reload this page.