-
-
Notifications
You must be signed in to change notification settings - Fork 2
test: add integration tests for sentence-length rule #31
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
3w36zj6
merged 17 commits into
textlint:main
from
r4ai:feature/add-sentence-length-tests
Mar 1, 2026
Merged
Changes from all commits
Commits
Show all changes
17 commits
Select commit
Hold shift + click to select a range
4dcd550
chore: add textlint-rule-sentence-length
r4ai 2a180a6
test: add integration tests for textlint-rule-sentence-length
r4ai 00cb2f0
style: apply biome
r4ai 14d1dde
Merge branch 'textlint:main' into feature/add-sentence-length-tests
r4ai b511e53
test: add test cases
r4ai ce8eccb
test: add invalid test cases and refactor test case files
r4ai bd65eac
Update test/integration/linting.test.ts
r4ai 3c0731c
test: fix file name
r4ai 360a15b
fix: trailing newline in inline comments being added as Str node
r4ai a102300
fix: wrap only inline children of list items in paragraphs
r4ai dc2367f
test: skip tests for term list because not supported yet
r4ai 3509c95
chore: update ast for example.typ by `update-fixtures`
r4ai e8b8402
test: update fixtures
r4ai b865e47
revert
r4ai 985b88e
test: skip failling tests due to implementation bug
r4ai 1aabf2f
test: expect failures instead of skipping cases
3w36zj6 29a6ed7
chore(deps): pin textlint-rule-sentence-length version to 5.2.1
3w36zj6 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
Some generated files are not rendered by default. Learn more about how customized files appear on GitHub.
Oops, something went wrong.
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
8 changes: 8 additions & 0 deletions
8
.../fixtures/smoke/textlint-rule-sentence-length/element_immediately_below_comment_valid.typ
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,8 @@ | ||
| = element immediately below a comment | ||
|
|
||
| // Single line comment | ||
| #let some_element = _ => { | ||
| let this_means_nothing = "Fake" | ||
| let another_meaningless_variable = 12345 | ||
| // ... | ||
| } |
9 changes: 9 additions & 0 deletions
9
test/integration/fixtures/smoke/textlint-rule-sentence-length/figure_valid.typ
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,9 @@ | ||
| = figure | ||
|
|
||
| #figure( | ||
| image("glacier.jpg", width: 70%), | ||
| caption: [ | ||
| _Glaciers_ form an important part | ||
| of the earth's climate system. | ||
| ], | ||
| ) <glaciers> |
5 changes: 5 additions & 0 deletions
5
test/integration/fixtures/smoke/textlint-rule-sentence-length/list_invalid.typ
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,5 @@ | ||
| = sentence in list | ||
|
|
||
| - List | ||
|
|
||
| Too long long long long long long long long long long long long long long long long long long long long long long long long long long long long long long long long long long long long long long long long long long long long long long long long long long long long long long sentence. |
5 changes: 5 additions & 0 deletions
5
test/integration/fixtures/smoke/textlint-rule-sentence-length/math_valid.typ
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,5 @@ | ||
| = math | ||
|
|
||
| $ | ||
| "Too long long long long long long long long long long long long long long long long long long long long long long long long long long long long long long long long long long long long long long long long long long long long long long long long long long long long long long math sentence." | ||
| $ |
6 changes: 6 additions & 0 deletions
6
test/integration/fixtures/smoke/textlint-rule-sentence-length/multiline_comment_valid.typ
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,6 @@ | ||
| = multiline comment | ||
|
|
||
| /* | ||
| Multiline comments should be ignored. | ||
| Too long long long long long long long long long long long long long long long long long long long long long long long long long long long long long long long long long long long long long long long long long long long long long long long long long long long long long long long sentence. | ||
| */ |
18 changes: 18 additions & 0 deletions
18
.../integration/fixtures/smoke/textlint-rule-sentence-length/nested_content_blocks_valid.typ
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,18 @@ | ||
| = nested content blocks | ||
|
|
||
| #[ | ||
| Some short sentence 1. | ||
|
|
||
| #[ | ||
| Some short sentence 2. | ||
| Some short sentence 3. | ||
| Some short sentence 4. | ||
| Some short sentence 5. | ||
| ] | ||
|
|
||
| #let some_element = _ => { | ||
| let this_means_nothing = "Fake" | ||
| let another_meaningless_variable = 12345 | ||
| // ... | ||
| } | ||
| ] |
30 changes: 30 additions & 0 deletions
30
test/integration/fixtures/smoke/textlint-rule-sentence-length/nested_list_valid.typ
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,30 @@ | ||
| = nested list | ||
|
|
||
| - Item 1 | ||
|
|
||
| - Nested Item 1 | ||
| - Nested Item 2 | ||
|
|
||
| - Item 2 | ||
|
|
||
| #let some_element = _ => { | ||
| let this_means_nothing = "Fake" | ||
| let another_meaningless_variable = 12345 | ||
| // ... | ||
| } | ||
|
|
||
| - Item 3 | ||
|
|
||
| $ | ||
| "Too long long long long long long long long long long long long long long long long long long long long long long long long long long long long long long long long long long long long long long long long long long long long long long long long long long long long long long math sentence." | ||
| $ | ||
|
|
||
| - Item 4 | ||
|
|
||
| #figure( | ||
| image("glacier.jpg", width: 70%), | ||
| caption: [ | ||
| _Glaciers_ form an important part | ||
| of the earth's climate system. | ||
| ], | ||
| ) <glaciers> |
4 changes: 4 additions & 0 deletions
4
test/integration/fixtures/smoke/textlint-rule-sentence-length/single_line_comment_valid.typ
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,4 @@ | ||
| = single line comment | ||
|
|
||
| // Single line comments should be ignored. | ||
| // Too long long long long long long long long long long long long long long long long long long long long long long long long long long long long long long long long long long long long long long long long long long long long long long long long long long long long long long long sentence. |
3 changes: 3 additions & 0 deletions
3
test/integration/fixtures/smoke/textlint-rule-sentence-length/term_list_invalid.typ
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,3 @@ | ||
| = sentence in term list | ||
|
|
||
| / Term: Too long long long long long long long long long long long long long long long long long long long long long long long long long long long long long long long long long long long long long long long long long long long long long long long long long long long long long long sentence. |
13 changes: 13 additions & 0 deletions
13
test/integration/fixtures/smoke/textlint-rule-sentence-length/term_list_valid.typ
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,13 @@ | ||
| = term list | ||
|
|
||
| / Term 1: First line. | ||
|
|
||
| Second line. | ||
| Third line. | ||
|
|
||
| / Nested Term 1: First line. | ||
|
|
||
| Lorem ipsum dolor sit amet, consectetur. | ||
|
|
||
| / Term 2: First line. | ||
| / Term 3: Third line. |
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
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.