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

Fix contraction of wh*re #21

Merged
merged 1 commit into from
May 25, 2022

Conversation

shakeelmohamed
Copy link
Contributor

Initial checklist

  • I read the support docs
  • I read the contributing guide
  • I agree to follow the code of conduct
  • I searched issues and couldn’t find anything (or linked relevant results below)
  • If applicable, I’ve added docs and tests

Description of changes

I noticed the contraction for who are (who're and who’re depending on quote style) being flagged downstream by https://github.com/get-alex/alex

This change ensures those forms are not normalized, and adds test for those two cases along with a plain whore string.

Without the change to en.js, the test cases fail:

TAP version 13
# profanities
ok 1 should warn
ok 2 should support other languages
ok 3 should warn about profanities
ok 4 should not warn for `ignore`d phrases
ok 5 should correctly depend on apostrophes
ok 6 should support plurals and singulars
ok 7 should warn about profanities
not ok 8 should not warn about `who are` contractions
  ---
    operator: deepEqual
    expected: |-
      [ '3:1-3:6: Don’t use `whore`, it’s profane' ]
    actual: |-
      [ '1:1-1:7: Don’t use `who\'re`, it’s profane', '2:1-2:7: Don’t use `who’re`, it’s profane', '3:1-3:6: Don’t use `whore`, it’s profane' ]
    stack: |-
      Error: should not warn about `who are` contractions
          at Test.assert [as _assert] (/Users/shakeelmohamed/work/git/retext-profanities/node_modules/tape/lib/test.js:314:54)
          at Test.bound [as _assert] (/Users/shakeelmohamed/work/git/retext-profanities/node_modules/tape/lib/test.js:99:32)
          at Test.tapeDeepEqual (/Users/shakeelmohamed/work/git/retext-profanities/node_modules/tape/lib/test.js:555:10)
          at Test.bound [as deepEqual] (/Users/shakeelmohamed/work/git/retext-profanities/node_modules/tape/lib/test.js:99:32)
          at file:///Users/shakeelmohamed/work/git/retext-profanities/test.js:131:9
          at processTicksAndRejections (internal/process/task_queues.js:97:5)
  ...

1..8
# tests 8
# pass  7
# fail  1

@github-actions github-actions bot added 👋 phase/new Post is being triaged automatically 🤞 phase/open Post is being triaged manually and removed 👋 phase/new Post is being triaged automatically labels May 25, 2022
@wooorm wooorm changed the title Do not normalize the contraction of "who are" (who're or who’re) Fix contraction of wh*re May 25, 2022
@wooorm wooorm merged commit 561d651 into retextjs:main May 25, 2022
@wooorm wooorm added 🐛 type/bug This is a problem 💪 phase/solved Post is done labels May 25, 2022
@github-actions

This comment has been minimized.

@github-actions github-actions bot removed the 🤞 phase/open Post is being triaged manually label May 25, 2022
@wooorm
Copy link
Member

wooorm commented May 25, 2022

Thanks, released! https://github.com/retextjs/retext-profanities/releases/tag/7.2.1

Sign up for free to join this conversation on GitHub. Already have an account? Sign in to comment
Labels
💪 phase/solved Post is done 🐛 type/bug This is a problem
Development

Successfully merging this pull request may close these issues.

None yet

2 participants