Skip to content

Commit 5e0a968

Browse files
DLumergify[bot]
authored andcommitted
Sentence checker (#4592)
* Sentence Checker * Some edits * Update About-Executors.rst * More sentence breaks * More cleanup * More sentences * Fix smart quotes * fix group tag indent for ROSCon 2023 and 2024 contents. (#5016) Signed-off-by: Tomoya Fujita <Tomoya.Fujita@sony.com> * Clean up sentences II (white space changes only) (#5017) * Exclude literals parts from bold parts in 'Ament Lint CLI Utilities' (#5024) You can't do nested inline markup in RST: **Can't do ``this`` in RST.** The simplest solution is to just exclude the ``literal`` part. Also, do some other minor fixes. Signed-off-by: Christophe Bedard <christophe.bedard@apex.ai> * remove --break-system-packages and address docker build warnings. (#5021) * remove --break-system-packages and address docker build warnings. Signed-off-by: Tomoya Fujita <Tomoya.Fujita@sony.com> * add github workflow to test Dockerfile. Signed-off-by: Tomoya Fujita <Tomoya.Fujita@sony.com> * Revert "add github workflow to test Dockerfile." This reverts commit 8686f18. Signed-off-by: Tomoya Fujita <Tomoya.Fujita@sony.com> --------- Signed-off-by: Tomoya Fujita <Tomoya.Fujita@sony.com> * More * Other sentence formatting (#5031) * Add second dot to abbreviations * Remove some random periods * Escape some periods * Convert some links * Add formatted block * Enable github/workflow to verify Dockerfile. (#5035) Signed-off-by: Tomoya Fujita <Tomoya.Fujita@sony.com> * Update Using-Node-Interfaces-Template-Class.rst (#5038) Added missing ``Output:`` before the terminal output for consistency reasons Signed-off-by: Nikos Tziaros <33639811+NickTziaros@users.noreply.github.com> * added Publishing-Messages-Using-YAML-Files.rst and edited Intermediat… (#5034) * added Publishing-Messages-Using-YAML-Files.rst and edited Intermediate.rst * Update source/Tutorials/Intermediate/Publishing-Messages-Using-YAML-Files.rst Co-authored-by: Tomoya Fujita <Tomoya.Fujita@sony.com> Signed-off-by: Nikos Tziaros <33639811+NickTziaros@users.noreply.github.com> * Update source/Tutorials/Intermediate/Publishing-Messages-Using-YAML-Files.rst Co-authored-by: Tomoya Fujita <Tomoya.Fujita@sony.com> Signed-off-by: Nikos Tziaros <33639811+NickTziaros@users.noreply.github.com> * Update source/Tutorials/Intermediate/Publishing-Messages-Using-YAML-Files.rst Signed-off-by: Nikos Tziaros <33639811+NickTziaros@users.noreply.github.com> * Update source/Tutorials/Intermediate/Publishing-Messages-Using-YAML-Files.rst Co-authored-by: Alejandro Hernández Cordero <ahcorde@gmail.com> Signed-off-by: Nikos Tziaros <33639811+NickTziaros@users.noreply.github.com> * Update source/Tutorials/Intermediate/Publishing-Messages-Using-YAML-Files.rst Co-authored-by: Alejandro Hernández Cordero <ahcorde@gmail.com> Signed-off-by: Nikos Tziaros <33639811+NickTziaros@users.noreply.github.com> * Update source/Tutorials/Intermediate/Publishing-Messages-Using-YAML-Files.rst Co-authored-by: Alejandro Hernández Cordero <ahcorde@gmail.com> Signed-off-by: Nikos Tziaros <33639811+NickTziaros@users.noreply.github.com> * Update source/Tutorials/Intermediate.rst Thanks for pointing it out, I didnt notice the extention beeing there Co-authored-by: Christophe Bedard <bedard.christophe@gmail.com> Signed-off-by: Nikos Tziaros <33639811+NickTziaros@users.noreply.github.com> * Update source/Tutorials/Intermediate/Publishing-Messages-Using-YAML-Files.rst Co-authored-by: Christophe Bedard <bedard.christophe@gmail.com> Signed-off-by: Nikos Tziaros <33639811+NickTziaros@users.noreply.github.com> --------- Signed-off-by: Nikos Tziaros <33639811+NickTziaros@users.noreply.github.com> Co-authored-by: Tomoya Fujita <Tomoya.Fujita@sony.com> Co-authored-by: Alejandro Hernández Cordero <ahcorde@gmail.com> Co-authored-by: Christophe Bedard <bedard.christophe@gmail.com> * more bits * Some rollbacks * Ignore * Use sphinx_tamer * More Sphinx Config * Updated checker using subprocess * Make sphinx-lint-with-ros exit with non-zero error codes Signed-off-by: Shane Loretz <shane.loretz@gmail.com> * Wrap r2d2.rviz in backticks Signed-off-by: Shane Loretz <sloretz@intrinsic.ai> * Wrap URL in RST link Signed-off-by: Shane Loretz <sloretz@intrinsic.ai> * Add empty line after section title Co-authored-by: Christophe Bedard <bedard.christophe@gmail.com> Signed-off-by: Shane Loretz <shane.loretz@gmail.com> * Add empty line after section title Co-authored-by: Christophe Bedard <bedard.christophe@gmail.com> Signed-off-by: Shane Loretz <shane.loretz@gmail.com> * Use normalized project name sphinx-tamer Co-authored-by: Tomoya Fujita <Tomoya.Fujita@sony.com> Signed-off-by: Shane Loretz <shane.loretz@gmail.com> * Make sentence checker ignore `.idl` Co-authored-by: Tomoya Fujita <Tomoya.Fujita@sony.com> Signed-off-by: Shane Loretz <shane.loretz@gmail.com> --------- Signed-off-by: Tomoya Fujita <Tomoya.Fujita@sony.com> Signed-off-by: Christophe Bedard <christophe.bedard@apex.ai> Signed-off-by: Nikos Tziaros <33639811+NickTziaros@users.noreply.github.com> Signed-off-by: Shane Loretz <shane.loretz@gmail.com> Signed-off-by: Shane Loretz <sloretz@intrinsic.ai> Co-authored-by: Tomoya Fujita <Tomoya.Fujita@sony.com> Co-authored-by: Christophe Bedard <christophe.bedard@apex.ai> Co-authored-by: Nikos Tziaros <33639811+NickTziaros@users.noreply.github.com> Co-authored-by: Alejandro Hernández Cordero <ahcorde@gmail.com> Co-authored-by: Christophe Bedard <bedard.christophe@gmail.com> Co-authored-by: Shane Loretz <shane.loretz@gmail.com> Co-authored-by: Shane Loretz <sloretz@intrinsic.ai> (cherry picked from commit 784fd45) # Conflicts: # source/Installation/Alternatives/Windows-Development-Setup.rst
1 parent 6c52a60 commit 5e0a968

36 files changed

+213
-85
lines changed

.sphinx_tamer.yaml

Lines changed: 10 additions & 0 deletions
Original file line numberDiff line numberDiff line change
@@ -0,0 +1,10 @@
1+
sentence_scan:
2+
extra_patterns:
3+
- Steven! Ragnar
4+
- ros2.org
5+
- nav2.org
6+
- ros2.repos
7+
- 2.X
8+
- (\s|^)(\.)(idl|msg|srv|action|NET|rviz)
9+
ignorable_prefixes:
10+
- Releases/

Makefile

Lines changed: 1 addition & 1 deletion
Original file line numberDiff line numberDiff line change
@@ -23,7 +23,7 @@ multiversion: Makefile
2323
@$(BUILD) -M $@ "$(SOURCE)" "$(OUT)" $(OPTS)
2424

2525
lint:
26-
sphinx-lint source
26+
./sphinx-lint-with-ros source
2727

2828
test:
2929
doc8 --ignore D001 --ignore-path build

plugins/ros_checkers.py

Lines changed: 16 additions & 0 deletions
Original file line numberDiff line numberDiff line change
@@ -0,0 +1,16 @@
1+
#!/usr/bin/python3
2+
from sphinxlint.checkers import checker
3+
import subprocess
4+
import yaml
5+
6+
7+
@checker('.rst', '.md')
8+
def check_sentence_count(file, lines, options=None):
9+
output = subprocess.check_output(['sphinx_sentence_scan_single', '.', file])
10+
results = yaml.safe_load(output)
11+
for result in results:
12+
sentences = result['sentences']
13+
for first, second in zip(sentences, sentences[1:]):
14+
words0 = ' '.join(first.split()[-3:]) # last three words
15+
words1 = ' '.join(second.split()[:3]) # first three words
16+
yield result['line_num'], f'Each sentence must start on a new line. Break between "{words0}" and "{words1}"'

requirements.txt

Lines changed: 1 addition & 0 deletions
Original file line numberDiff line numberDiff line change
@@ -9,3 +9,4 @@ sphinx-multiversion
99
sphinx-rtd-theme
1010
sphinx-tabs
1111
sphinxcontrib-mermaid
12+
sphinx-tamer

source/Concepts/Intermediate/About-Executors.rst

Lines changed: 1 addition & 1 deletion
Original file line numberDiff line numberDiff line change
@@ -202,4 +202,4 @@ Further information
202202
ROS Industrial Conference.
203203
Virtual event.
204204
16 December 2020.
205-
* Daniel Casini, Tobias Blass, Ingo Lütkebohle, and Björn Brandenburg: `"Response-Time Analysis of ROS 2 Processing Chains under Reservation-Based Scheduling" <https://drops.dagstuhl.de/opus/volltexte/2019/10743/pdf/LIPIcs-ECRTS-2019-6.pdf>`_, Proc. of 31st ECRTS 2019, Stuttgart, Germany, July 2019.
205+
* Daniel Casini, Tobias Blass, Ingo Lütkebohle, and Björn Brandenburg: `"Response-Time Analysis of ROS 2 Processing Chains under Reservation-Based Scheduling" <https://drops.dagstuhl.de/opus/volltexte/2019/10743/pdf/LIPIcs-ECRTS-2019-6.pdf>`_, Proceedings of 31st ECRTS 2019, Stuttgart, Germany, July 2019.

source/Contact.rst

Lines changed: 1 addition & 1 deletion
Original file line numberDiff line numberDiff line change
@@ -59,7 +59,7 @@ If following a tutorial or online instructions provide a link to the specific in
5959

6060
* Use a descriptive headline or subject line.
6161
Bad: "rviz doesn't work".
62-
Good: "Rviz crashing looking for missing .so after latest apt update"
62+
Good: "Rviz crashing looking for missing ``.so`` after latest apt update"
6363
* Include information about the exact platform, software, versions, and environment relevant to the problem.
6464
This includes how you installed the software (from binaries or from source) and which ROS middleware/DDS vendor you are using (if you know it).
6565
* Any warnings or errors.

source/How-To-Guides/Documenting-a-ROS-2-Package.rst

Lines changed: 3 additions & 3 deletions
Original file line numberDiff line numberDiff line change
@@ -240,6 +240,6 @@ On each job page, you can see when a build was last triggered, as well as the st
240240
Further Reading
241241
---------------
242242

243-
* ``rosdoc2`` readme: https://github.com/ros-infrastructure/rosdoc2/blob/main/README.md
244-
* ROS 2 design document on package documentation: https://design.ros2.org/articles/per_package_documentation.html
245-
* The ROS 2 cookbook: https://github.com/mikeferguson/ros2_cookbook/blob/main/pages/rosdoc2.md
243+
* `rosdoc2 readme <https://github.com/ros-infrastructure/rosdoc2/blob/main/README.md>`_
244+
* `ROS 2 design document on package documentation <https://design.ros2.org/articles/per_package_documentation.html>`_
245+
* `The ROS 2 cookbook <https://github.com/mikeferguson/ros2_cookbook/blob/main/pages/rosdoc2.md>`_

source/How-To-Guides/Migrating-from-ROS1/Migrating-Launch-Files.rst

Lines changed: 1 addition & 1 deletion
Original file line numberDiff line numberDiff line change
@@ -13,7 +13,7 @@ Migrating Launch Files
1313
:depth: 1
1414
:local:
1515

16-
While launch files in ROS 1 are always specified using `.xml <https://wiki.ros.org/roslaunch/XML>`__ files, ROS 2 supports Python scripts to enable more flexibility (see `launch package <https://github.com/ros2/launch/tree/{REPOS_FILE_BRANCH}/launch>`__) as well as XML and YAML files.
16+
While launch files in ROS 1 are always specified using `xml <https://wiki.ros.org/roslaunch/XML>`__ files, ROS 2 supports Python scripts to enable more flexibility (see `launch package <https://github.com/ros2/launch/tree/{REPOS_FILE_BRANCH}/launch>`__) as well as XML and YAML files.
1717

1818
This guide describes how to write ROS 2 XML launch files for an easy migration from ROS 1.
1919

source/How-To-Guides/Releasing/Release-Track.rst

Lines changed: 2 additions & 1 deletion
Original file line numberDiff line numberDiff line change
@@ -112,7 +112,8 @@ Most repositories will be using git, but some legacy repositories might be using
112112
Version
113113
^^^^^^^
114114
115-
This is the version of the package you are releasing. (e.g. ``1.0.3``)
115+
This is the version of the package you are releasing.
116+
(e.g. ``1.0.3``)
116117
117118
.. code-block:: bash
118119

source/How-To-Guides/Releasing/Releasing-a-Package.rst

Lines changed: 1 addition & 1 deletion
Original file line numberDiff line numberDiff line change
@@ -20,7 +20,7 @@ Releasing a Package
2020
**Releasing a package makes your package available on the public ROS 2 buildfarm.**
2121
This will:
2222

23-
* Make your package available to be installed via package managers (eg. ``apt`` on Ubuntu) for all supported Linux platforms in a ROS distribution as described in `REP 2000 <https://ros.org/reps/rep-2000.html>`_.
23+
* Make your package available to be installed via package managers (e.g. ``apt`` on Ubuntu) for all supported Linux platforms in a ROS distribution as described in `REP 2000 <https://ros.org/reps/rep-2000.html>`_.
2424
* Allow your package to have API documentation automatically generated.
2525
* Make your package part of the `ROS Index <https://index.ros.org>`_.
2626
* (Optionally) Allow you to have automatic CI run for pull requests in your repository.

0 commit comments

Comments
 (0)