-
Notifications
You must be signed in to change notification settings - Fork 77
Commit
This commit does not belong to any branch on this repository, and may belong to a fork outside of the repository.
Merging branch/2023-01-13/rst-check for GitHub pull request 112 <#112>
- Loading branch information
Showing
12 changed files
with
123 additions
and
19 deletions.
There are no files selected for viewing
This file contains 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 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 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 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 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 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 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 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 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 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 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 |
---|---|---|
|
@@ -280,7 +280,7 @@ B. Document History | |
.. _NB: mailto:[email protected] | ||
.. _RHSK: mailto:[email protected] | ||
.. _GDR: mailto:[email protected] | ||
.. _PNJ mailto:[email protected] | ||
.. _PNJ: mailto:[email protected] | ||
|
||
C. Copyright and License | ||
------------------------ | ||
|
This file contains 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$ |