Skip to content

Commit

Permalink
Add spell-checking for GitLab (#175)
Browse files Browse the repository at this point in the history
  • Loading branch information
hyperupcall authored Oct 13, 2023
1 parent d0c2858 commit 9adfa76
Show file tree
Hide file tree
Showing 5 changed files with 33 additions and 0 deletions.
4 changes: 4 additions & 0 deletions lib/spell-check-rules.js
Original file line number Diff line number Diff line change
Expand Up @@ -24,5 +24,9 @@ module.exports = [
{
test: /\bgit\s?hub\b/gi,
value: 'GitHub'
},
{
test: /\bgit\s?lab\b/gi,
value: 'GitLab'
}
];
5 changes: 5 additions & 0 deletions test/fixtures/spell-check/error0.md
Original file line number Diff line number Diff line change
Expand Up @@ -45,3 +45,8 @@ Test spell-check on basic text nodes.
- Git Hub is cool but GitHub is cooler
- github is cool but GitHub is cooler
- git hub is cool but GitHub is cooler

- Gitlab is cool but GitLab is cooler
- Git Lab is cool but GitLab is cooler
- gitlab is cool but GitLab is cooler
- git lab is cool but GitLab is cooler
4 changes: 4 additions & 0 deletions test/fixtures/spell-check/success0.md
Original file line number Diff line number Diff line change
Expand Up @@ -24,6 +24,10 @@ This file should not generate any spell-check errors.

[GitHub](https://foo.com) - GitHub

## GitLab

[GitLab](https://foo.com) - GitLab

These are special-cases which should not cause errors.

- [awesome-cross-platform-nodejs](https://github.com/bcoe/awesome-cross-platform-nodejs)
Expand Down
20 changes: 20 additions & 0 deletions test/rules/snapshots/spell-check.js.md
Original file line number Diff line number Diff line change
Expand Up @@ -164,4 +164,24 @@ Generated by [AVA](https://ava.li).
message: 'Text "git hub" should be written as "GitHub"',
ruleId: 'awesome-spell-check',
},
{
line: 49,
message: 'Text "Gitlab" should be written as "GitLab"',
ruleId: 'awesome-spell-check',
},
{
line: 50,
message: 'Text "Git Lab" should be written as "GitLab"',
ruleId: 'awesome-spell-check',
},
{
line: 51,
message: 'Text "gitlab" should be written as "GitLab"',
ruleId: 'awesome-spell-check',
},
{
line: 52,
message: 'Text "git lab" should be written as "GitLab"',
ruleId: 'awesome-spell-check',
},
]
Binary file modified test/rules/snapshots/spell-check.js.snap
Binary file not shown.

0 comments on commit 9adfa76

Please sign in to comment.