-
Notifications
You must be signed in to change notification settings - Fork 1.2k
Sentence checker #4592
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
Sentence checker #4592
Changes from 34 commits
Commits
Show all changes
36 commits
Select commit
Hold shift + click to select a range
83c4a3f
Sentence Checker
DLu b9ae133
Some edits
DLu 35e6d2c
Update About-Executors.rst
DLu bbf8276
Merge remote-tracking branch 'upstream/rolling' into sentence_checker
DLu f94bd87
More sentence breaks
DLu c41bce7
More cleanup
DLu a124441
Merge remote-tracking branch 'upstream/rolling' into sentence_checker
DLu dd5e31b
More sentences
DLu e528e88
Fix smart quotes
DLu 242fd36
fix group tag indent for ROSCon 2023 and 2024 contents. (#5016)
fujitatomoya 6f11e8e
Clean up sentences II (white space changes only) (#5017)
DLu 3ae6da5
Exclude literals parts from bold parts in 'Ament Lint CLI Utilities' …
christophebedard f6df16f
remove --break-system-packages and address docker build warnings. (#5…
fujitatomoya a8393ea
More
DLu 67f3b99
Other sentence formatting (#5031)
DLu 16461f4
Enable github/workflow to verify Dockerfile. (#5035)
fujitatomoya d83010a
Update Using-Node-Interfaces-Template-Class.rst (#5038)
NickTziaros 9f87b52
added Publishing-Messages-Using-YAML-Files.rst and edited Intermediat…
NickTziaros 253558e
more bits
DLu f4fc30c
Merge remote-tracking branch 'upstream/rolling' into sentence_checker
DLu f737ebd
Some rollbacks
DLu fbe0073
Merge remote-tracking branch 'upstream/rolling' into sentence_checker
DLu 24c3446
Ignore
DLu 284b463
Use sphinx_tamer
DLu 7dd414d
Merge remote-tracking branch 'upstream/rolling' into sentence_checker
DLu 1a6c15f
More Sphinx Config
DLu 5071af4
Updated checker using subprocess
DLu 2c8d92b
Merge remote-tracking branch 'upstream/rolling' into sentence_checker
DLu b9f59bb
Merge remote-tracking branch 'upstream/rolling' into sentence_checker
DLu 0249b30
Make sphinx-lint-with-ros exit with non-zero error codes
sloretz eb54783
Wrap r2d2.rviz in backticks
sloretz 71cfbfb
Wrap URL in RST link
sloretz 27190d7
Add empty line after section title
sloretz c2ac7a4
Add empty line after section title
sloretz 3003bc0
Use normalized project name sphinx-tamer
sloretz c01a5bd
Make sentence checker ignore `.idl`
sloretz 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,10 @@ | ||
| sentence_scan: | ||
| extra_patterns: | ||
| - Steven! Ragnar | ||
| - ros2.org | ||
| - nav2.org | ||
| - ros2.repos | ||
| - 2.X | ||
| - (\s|^)(\.)(msg|srv|action|NET|rviz) | ||
| ignorable_prefixes: | ||
| - Releases/ | ||
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,16 @@ | ||
| #!/usr/bin/python3 | ||
| from sphinxlint.checkers import checker | ||
| import subprocess | ||
| import yaml | ||
|
|
||
|
|
||
| @checker('.rst', '.md') | ||
| def check_sentence_count(file, lines, options=None): | ||
| output = subprocess.check_output(['sphinx_sentence_scan_single', '.', file]) | ||
sloretz marked this conversation as resolved.
Show resolved
Hide resolved
|
||
| results = yaml.safe_load(output) | ||
| for result in results: | ||
| sentences = result['sentences'] | ||
| for first, second in zip(sentences, sentences[1:]): | ||
| words0 = ' '.join(first.split()[-3:]) # last three words | ||
| words1 = ' '.join(second.split()[:3]) # first three words | ||
| yield result['line_num'], f'Each sentence must start on a new line. Break between "{words0}" and "{words1}"' | ||
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
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 |
|---|---|---|
| @@ -1 +1,2 @@ | ||
| **Note**: If you're using a distribution that is based on Ubuntu (like Linux Mint) but does not identify itself as such, you'll get an error message like ``Unsupported OS [mint]``. In this case append ``--os=ubuntu:noble`` to the above command. | ||
| **Note**: If you're using a distribution that is based on Ubuntu (like Linux Mint) but does not identify itself as such, you'll get an error message like ``Unsupported OS [mint]``. | ||
| In this case append ``--os=ubuntu:noble`` to the above command. |
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
Oops, something went wrong.
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.