forked from rowanmanning/joblint
-
Notifications
You must be signed in to change notification settings - Fork 0
Expand file tree
/
Copy pathrealism.js
More file actions
39 lines (34 loc) · 1.22 KB
/
realism.js
File metadata and controls
39 lines (34 loc) · 1.22 KB
1
2
3
4
5
6
7
8
9
10
11
12
13
14
15
16
17
18
19
20
21
22
23
24
25
26
27
28
29
30
31
32
33
34
35
36
37
38
39
'use strict';
module.exports = defineRules;
var visionaryWords = [
/blue\s*sk(?:y|ies)/,
/enlighten(?:ed|ing)?/,
/green\s*fields?/,
/incentivi[sz]e/,
'paradigm',
/producti[sz]e/,
/reach(?:ed|ing) out/,
/synerg(?:y|ize|ise)/,
/visionar(?:y|ies)/
];
function defineRules (linter) {
// Visionary terminology
linter.addRule({
name: 'Visionary Terminology',
desc: 'Terms like "blue sky" and "enlightened" often indicate that a non technical ' +
'person (perhaps a CEO or stakeholder) has been involved in writing the spec. Be ' +
'down-to-earth, and explain things in plain English.',
test: function (spec, result) {
var visionaryMentions = spec.containsAnyOf(visionaryWords);
var amount = (visionaryMentions.length > 2 ? 'Lots of' : 'Some');
if (visionaryMentions.length > 0) {
result.addWarning(
amount + ' "visionary" terminology is used',
visionaryMentions
);
result.addCultureFailPoints(visionaryMentions.length / 2);
result.addRealismFailPoints(visionaryMentions.length / 2);
}
}
});
}