Skip to content

Commit

Permalink
Remove support for Duo
Browse files Browse the repository at this point in the history
Update dependencies; refactor code-style; update Travis targets.
  • Loading branch information
wooorm committed Jun 23, 2016
1 parent 2b13384 commit f5dc274
Show file tree
Hide file tree
Showing 13 changed files with 52 additions and 100 deletions.
2 changes: 1 addition & 1 deletion .editorconfig
Original file line number Diff line number Diff line change
Expand Up @@ -8,7 +8,7 @@ charset = utf-8
trim_trailing_whitespace = true
insert_final_newline = true

[*.{json,remarkrc,eslintrc,sh}]
[*.{json,remarkrc,eslintrc,sh,yml}]
indent_size = 2

[*.md]
Expand Down
1 change: 0 additions & 1 deletion .eslintignore
Original file line number Diff line number Diff line change
@@ -1,4 +1,3 @@
components/
coverage/
retext-profanities.js
retext-profanities.min.js
3 changes: 1 addition & 2 deletions .gitignore
Original file line number Diff line number Diff line change
@@ -1,7 +1,6 @@
.DS_Store
*.log
components/
coverage/
node_modules/
coverage/
retext-profanities.js
retext-profanities.min.js
13 changes: 8 additions & 5 deletions .jscs.json
Original file line number Diff line number Diff line change
@@ -1,6 +1,5 @@
{
"excludeFiles": [
"components/",
"coverage/",
"node_modules/",
"retext-profanities.js",
Expand All @@ -9,17 +8,21 @@
"preset": "crockford",
"requireMultipleVarDecl": false,
"disallowDanglingUnderscores": false,
"disallowQuotedKeysInObjects": {
"allExcept": [
"reserved"
]
},
"disallowKeywords": [
"with"
],
"maximumLineLength": {
"value": 79,
"allExcept": [
"regex",
"urlComments"
]
},
"requireQuotedKeysInObjects": true,
"disallowKeywords": [
"with"
],
"jsDoc": {
"checkAnnotations": "jsdoc3",
"checkParamExistence": true,
Expand Down
1 change: 0 additions & 1 deletion .remarkignore

This file was deleted.

12 changes: 7 additions & 5 deletions .travis.yml
Original file line number Diff line number Diff line change
@@ -1,25 +1,27 @@
language: node_js
node_js:
- '0.10'
- '0.11'
- '0.12'
- '4.0'
- '5.0'
- iojs
- '6.0'
sudo: false
after_script: npm install codecov.io && cat ./coverage/lcov.info | codecov
after_success:
- bash <(curl -s https://codecov.io/bash)
deploy:
- provider: npm
email: [email protected]
api_key:
secure: SrmjGDU9SpFwJckLQf2PwVPgJZaiUAZoR8t7mIZHcmE1TqtRlTq1w839hlP7XpLuEOlqYlUCppFQv3IZhEUy7gN+o95rE5BciLeajrtI+w6S8du5AzxkaEzMxR3DKTjy6p+sGlZZ+4QH6y1P1QJXIbod9Xw4vpv5KBZslOgicmLLTrI/Q6ConU+w0J5cTKmmLh/afVEHJ3vPq2smYZQnRRomM3IQj4BcpBXmSTa52KqYdSRjzAXPn8JNpO8QCunMISi5gdfTDRZaqZO3J7ihaYe2xh0vQdUaef1bseVTLlFJW7xW/IQmXWPKvV4R5r38vKje5Tqz3FC7mmmRHX7COlnWxgHGytgNgJKuQdHCzaz6u7K2rJm/nAhwLcCplXVPGNbDdXscHo0oMRi8MI4gKmXhpvoxxN4FaNgsKgdFr4gPUvtJ6kdMBsE2gax+KUrlvEQEGDZhK8mRFh3irZtwci9UEc6pkg9/Yu/YMiEG0AfS/JZSFz0syxpSZjWStmTlJ4RSct6sdHKFfcIl61uCxS8Ca2P7RvOZItn449heaWt0XYgBv3/W5xgBV+BUjaCU8f3KXhuZA1doHlC94h8ebDR5OCQg6g6NcukeyxozGr1GrFCdDH4QQwJBgjKju6onQAzbep13RTsQZ7T/AdmnvEkQJRVwEhQEzVrVBg96R18=
secure: SrmjGDU9SpFwJckLQf2PwVPgJZaiUAZoR8t7mIZHcmE1TqtRlTq1w839hlP7XpLuEOlqYlUCppFQv3IZhEUy7gN+o95rE5BciLeajrtI+w6S8du5AzxkaEzMxR3DKTjy6p+sGlZZ+4QH6y1P1QJXIbod9Xw4vpv5KBZslOgicmLLTrI/Q6ConU+w0J5cTKmmLh/afVEHJ3vPq2smYZQnRRomM3IQj4BcpBXmSTa52KqYdSRjzAXPn8JNpO8QCunMISi5gdfTDRZaqZO3J7ihaYe2xh0vQdUaef1bseVTLlFJW7xW/IQmXWPKvV4R5r38vKje5Tqz3FC7mmmRHX7COlnWxgHGyt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w98B7aT6dzHOnU+66zwiOtZAjf/ENCtwEWnv0Y/lTGa87L3OzGGWm23tuT24rkLn6tPtMOqcREFXe8RuGRe1dwXO06fF6KiP1Ryfjpx8Xyqo+gjwNk+f6sCGPTpI0v9qjUp1sCGiLKv5FYcYaV4zQlwbT4K1Ux2jxdIJRar9qyuUls5G+8mQ/PWPOhvWLgewri95MY95wojemRdmRQgI1nCNhxY1I860dgTXR6B79IA2ajYiGS/OCCUSTooqBK7f1l5Wb0qDXFFoUmEVAlpjgin99Qz3NFyJgl6XJejTJ8H40RfWXaQowsCINEiZ6T2x2M99LoeGr4Ae+OfEx/KfhF6pF/iKvDnjKkVDrDCbG0N7lj8NtYKubmnKctQ/5WWDKpt7wq+zb82WTq56SZvDLD0WUrudhAvZvw6XwcyT31vaEuJ4p/774GE0uriBy/FtFGC+8H57mLV3G1B6wUAwyE7bZhe4xTXfTBy2WobKJvpGAU5Vl+9Wz0A/pIVvVD8n/JVO7lpFx3cjcyIMTQeBI3f28XSi/BllUrijuCP0KjbXGfwu8yDdLXQCC69QzfvWoyjzGdYtQilZkPPHmB25ewwv54smwB+UOjcVodQgx60vrZ+e1mNvEpgLi/YbFgr6OnQ6mTGgIwYsXForiqwA=
file:
- "retext-profanities.js"
- "retext-profanities.min.js"
on:
tags: true
node: '6.0'
2 changes: 1 addition & 1 deletion LICENSE
Original file line number Diff line number Diff line change
@@ -1,6 +1,6 @@
(The MIT License)

Copyright (c) 2016 Titus Wormer <mailto:[email protected]>
Copyright (c) 2016 Titus Wormer <[email protected]>

Permission is hereby granted, free of charge, to any person obtaining
a copy of this software and associated documentation files (the
Expand Down
27 changes: 0 additions & 27 deletions component.json

This file was deleted.

2 changes: 1 addition & 1 deletion history.md
Original file line number Diff line number Diff line change
@@ -1,6 +1,6 @@
<!--remark setext-->

<!--lint disable no-multiple-toplevel-headings -->
<!--lint disable no-multiple-toplevel-headings-->

2.1.0 / 2016-06-08
==================
Expand Down
35 changes: 10 additions & 25 deletions index.js
Original file line number Diff line number Diff line change
Expand Up @@ -2,18 +2,15 @@
* @author Titus Wormer
* @copyright 2016 Titus Wormer
* @license MIT
* @module retext:profanities
* @fileoverview Check for profane and vulgar wording with retext.
* @module retext:simplify
* @fileoverview Check phrases for simpler alternatives.
*/

'use strict';

/* eslint-env commonjs */

/*
* Dependencies.
*/

/* Dependencies. */
var keys = require('object-keys');
var difference = require('array-differ');
var intersection = require('array-intersection');
Expand All @@ -22,26 +19,17 @@ var quotation = require('quotation');
var search = require('nlcst-search');
var cuss = require('cuss');

/*
* List of values not to normalize.
*/

/* List of values not to normalize. */
var APOSTROPHES = ['hell'];

/*
* Map of `cuss` ratings to suffixes.
*/

/* Map of `cuss` ratings to prefixes. */
var PREFIX = [
'Be careful with',
'Reconsider using',
'Don’t use'
];

/*
* Map of `cuss` ratings to suffixes.
*/

/* Map of `cuss` ratings to suffixes. */
var SUFFIX = [
'it’s profane in some cases',
'it may be profane',
Expand All @@ -51,7 +39,7 @@ var SUFFIX = [
/**
* Attacher.
*
* @param {Retext} processor
* @param {Unified} processor
* - Instance.
* @param {Object?} [options]
* - Configuration.
Expand Down Expand Up @@ -88,8 +76,8 @@ function attacher(processor, options) {
quotation(nlcstToString(match), '“', '”') + ',',
SUFFIX[rating]
].join(' '), {
'start': match[0].position.start,
'end': match[match.length - 1].position.end
start: match[0].position.start,
end: match[match.length - 1].position.end
});

message.ruleId = phrase;
Expand All @@ -104,8 +92,5 @@ function attacher(processor, options) {
return transformer;
}

/*
* Expose.
*/

/* Expose. */
module.exports = attacher;
15 changes: 7 additions & 8 deletions package.json
Original file line number Diff line number Diff line change
Expand Up @@ -29,7 +29,7 @@
"array-intersection": "^0.1.2",
"cuss": "^1.1.0",
"nlcst-search": "^1.0.0",
"nlcst-to-string": "^1.1.0",
"nlcst-to-string": "^2.0.0",
"object-keys": "^1.0.9",
"quotation": "^1.0.0"
},
Expand All @@ -40,14 +40,13 @@
"istanbul": "^0.4.0",
"jscs": "^3.0.0",
"jscs-jsdoc": "^2.0.0",
"remark": "^4.0.0",
"remark-comment-config": "^3.0.0",
"remark-github": "^4.0.1",
"remark-cli": "^1.0.0",
"remark-comment-config": "^4.0.0",
"remark-github": "^5.0.0",
"remark-lint": "^4.0.0",
"remark-validate-links": "^3.0.0",
"retext": "^2.0.0",
"tape": "^4.0.0",
"vfile-reporter": "^1.5.0"
"remark-validate-links": "^4.0.0",
"retext": "^3.0.0",
"tape": "^4.0.0"
},
"scripts": {
"build-md": "remark . --quiet --frail",
Expand Down
25 changes: 11 additions & 14 deletions readme.md
Original file line number Diff line number Diff line change
@@ -1,7 +1,9 @@
# retext-profanities [![Build Status][travis-badge]][travis] [![Coverage Status][codecov-badge]][codecov]

<!--lint disable heading-increment list-item-spacing-->

Check for [profane and vulgar][profanities] wording with
[**retext**][retext].
[**retext**][retext]. Uses [cuss][] for sureness.

## Installation

Expand All @@ -11,8 +13,8 @@ Check for [profane and vulgar][profanities] wording with
npm install retext-profanities
```

**retext-profanities** is also available for [duo][duo-install], and as an
AMD, CommonJS, and globals module, [uncompressed and compressed][releases].
**retext-profanities** is also available as an AMD, CommonJS, and
globals module, [uncompressed and compressed][releases].

## Usage

Expand Down Expand Up @@ -41,18 +43,13 @@ Yields:

## API

### `retext.use(profanities[, options])`

Check for [profane and vulgar][profanities] wording.

**Parameters**
### `retext().use(profanities[, options])`

* `profanities` — This plug-in;
Check phrases for simpler alternatives.

* `options` (`Object?`, optional):
###### `options`

* `ignore` (`Array.<string>`)
— List of phrases to _not_ warn about.
* `ignore` (`Array.<string>`) — phrases _not_ to warn about.

## License

Expand All @@ -70,8 +67,6 @@ Check for [profane and vulgar][profanities] wording.

[npm-install]: https://docs.npmjs.com/cli/install

[duo-install]: http://duojs.org/#getting-started

[releases]: https://github.com/wooorm/retext-profanities/releases

[license]: LICENSE
Expand All @@ -81,3 +76,5 @@ Check for [profane and vulgar][profanities] wording.
[retext]: https://github.com/wooorm/retext

[profanities]: https://github.com/wooorm/profanities

[cuss]: https://github.com/wooorm/cuss
14 changes: 5 additions & 9 deletions test.js
Original file line number Diff line number Diff line change
Expand Up @@ -9,19 +9,15 @@
'use strict';

/* eslint-env node */
/* jscs:disable jsDoc */
/* jscs:disable maximumLineLength */

/*
* Dependencies.
*/

/* Dependencies. */
var test = require('tape');
var retext = require('retext');
var profanities = require('./');

/*
* Tests.
*/

/* Tests. */
test('profanities', function (t) {
t.plan(6);

Expand All @@ -48,7 +44,7 @@ test('profanities', function (t) {

retext()
.use(profanities, {
'ignore': ['butt']
ignore: ['butt']
})
.process([
'He’s pretty set on beating your butt for sheriff.'
Expand Down

0 comments on commit f5dc274

Please sign in to comment.