Skip to content
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

feat: add frequent typo-catching rules #249

Merged
merged 2 commits into from
May 31, 2021
Merged

feat: add frequent typo-catching rules #249

merged 2 commits into from
May 31, 2021

Conversation

jay7x
Copy link
Contributor

@jay7x jay7x commented May 1, 2021

As Salt is unable to catch some frequent typos there are few checks:

  • "onchange" (must be "onchanges")
  • "requires" (must be "require")
  • "content" (must be "contents")

@jay7x
Copy link
Contributor Author

jay7x commented May 1, 2021

I put those rules as 'formatting' though we may have 'typos' category maybe..

@jbouter
Copy link
Member

jbouter commented May 1, 2021

👋 Hi @jay7x! Thanks for your PR! We are currently a bit short on time, but we'll try to look at your code soon.

Copy link
Member

@jbouter jbouter left a comment

Choose a reason for hiding this comment

The reason will be displayed to describe this comment to others. Learn more.

Some minor suggestions :-)

tests/unit/TestTypoOnchangesRule.py Outdated Show resolved Hide resolved
tests/unit/TestTypoOnchangesRule.py Outdated Show resolved Hide resolved
tests/unit/TestTypoOnchangesRule.py Outdated Show resolved Hide resolved
tests/unit/TestTypoOnchangesRule.py Outdated Show resolved Hide resolved
tests/unit/TestTypoRequireRule.py Outdated Show resolved Hide resolved
tests/unit/TestTypoRequireRule.py Outdated Show resolved Hide resolved
tests/unit/TestTypoContentsRule.py Outdated Show resolved Hide resolved
tests/unit/TestTypoContentsRule.py Outdated Show resolved Hide resolved
tests/unit/TestTypoContentsRule.py Outdated Show resolved Hide resolved
tests/unit/TestTypoContentsRule.py Outdated Show resolved Hide resolved
@jay7x
Copy link
Contributor Author

jay7x commented May 2, 2021

Ah! I see.. I missed somehow that BAD_XXX_LINE & GOOD_XXX_LINE are different for every test :-D

As Salt is unable to catch some frequent typos there are few checks:
- "onchange" (must be "onchanges")
- "requires" (must be "require")
- "content" (must be "contents")
@jbouter
Copy link
Member

jbouter commented May 2, 2021

Approved on my end, but I'd like a review by @roaldnefs as well.

@jbouter jbouter requested a review from roaldnefs May 2, 2021 08:02
@jay7x
Copy link
Contributor Author

jay7x commented May 31, 2021

Any chance for this PR to be merged or declined soon? :-D

Simplify the typographical error rules by creating a base
`TypographicalErrorRule` that can be extended by a simple regex. This
commit also adds the missing `CHANGELOG.md` entry.

Signed-off-by: Roald Nefs <info@roaldnefs.com>
Copy link
Member

@roaldnefs roaldnefs left a comment

Choose a reason for hiding this comment

The reason will be displayed to describe this comment to others. Learn more.

Besides the missing CHANGELOG.md entry I've made some minor changes by adding a TypographicalErrorRule base rule that can easily be extended by any of the typographical error rules.

@roaldnefs roaldnefs changed the title Add few frequent typo-catching rules feat: add frequent typo-catching rules May 31, 2021
@roaldnefs roaldnefs merged commit 823e864 into warpnet:main May 31, 2021
@jay7x jay7x deleted the more_rules branch June 1, 2021 13:44
Sign up for free to join this conversation on GitHub. Already have an account? Sign in to comment
Labels
None yet
Projects
None yet
Development

Successfully merging this pull request may close these issues.

3 participants