forked from rowanmanning/joblint
-
Notifications
You must be signed in to change notification settings - Fork 0
Expand file tree
/
Copy pathtech.js
More file actions
130 lines (119 loc) · 4.34 KB
/
tech.js
File metadata and controls
130 lines (119 loc) · 4.34 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
40
41
42
43
44
45
46
47
48
49
50
51
52
53
54
55
56
57
58
59
60
61
62
63
64
65
66
67
68
69
70
71
72
73
74
75
76
77
78
79
80
81
82
83
84
85
86
87
88
89
90
91
92
93
94
95
96
97
98
99
100
101
102
103
104
105
106
107
108
109
110
111
112
113
114
115
116
117
118
119
120
121
122
123
124
125
126
127
128
129
130
'use strict';
module.exports = defineRules;
var legacyTech = [
'cobol',
'cvs',
/front\s*page/,
'rcs',
'sccs',
/source\s*safe/,
/vb\s*6/,
/visual\s*basic\s*6/,
'vbscript'
];
var environments = [
/bb\s*edit/,
/dream\s*weaver/,
'eclipse',
'emacs',
/net\s*beans/,
/note\s*pad/,
/sublime\s*text/,
/text\s*wrangler/,
/text\s*mate/,
/vim?/,
/visual\s*studio/
];
var expandedAcronyms = [
/cascading[\s\-]?style[\s\-]?sheets/,
/hyper[\s\-]?text([\s\-]?mark[\s\-]?up([\s\-]?language)?)?/
];
function defineRules (linter) {
// Legacy technology
linter.addRule({
name: 'Legacy Technology',
desc: 'Legacy technologies can reduce the number of people interested in a job. ' +
'Sometimes we can\'t avoid this, but extreme legacy tech can often indicate that ' +
'a company isn\'t willing to move forwards or invest in career development.',
test: function (spec, result) {
var legacyTechMentions = spec.containsAnyOf(legacyTech);
if (legacyTechMentions.length > 0) {
result.addNotice(
'Legacy technologies found: ' +
legacyTechMentions.join(', '),
legacyTechMentions
);
result.addTechFailPoints(legacyTechMentions.length);
result.addRealismFailPoints(1);
}
}
});
// Prescribed environment
linter.addRule({
name: 'Prescribed Development Environment',
desc: 'Unless you\'re building in a something which requires a certain development ' +
'environment (e.g. iOS development and XCode), it shouldn\'t matter which tools a ' +
'developer decides to use to write code – their output will be better if they are ' +
'working in a familiar environment.',
test: function (spec, result) {
var environmentMentions = spec.containsAnyOf(environments);
if (environmentMentions.length > 0) {
result.addNotice(
'Development environment is prescribed: ' +
environmentMentions.join(', '),
environmentMentions
);
result.addTechFailPoints(environmentMentions.length);
result.addCultureFailPoints(1);
}
}
});
// Expanded acronyms
linter.addRule({
name: 'Expanded Acronyms',
desc: 'Tech people know their acronyms; you come across as not very tech-savvy if you ' +
'expand them. You could be putting people off of the job spec by using these.',
test: function (spec, result) {
var expandedAcronymUsage = spec.containsAnyOf(expandedAcronyms);
if (expandedAcronymUsage.length > 0) {
result.addWarning(
'Acronyms are expanded: ' +
expandedAcronymUsage.join(', '),
expandedAcronymUsage
);
result.addTechFailPoints(expandedAcronymUsage.length / 2);
result.addRecruiterFailPoints(expandedAcronymUsage.length);
}
}
});
// JavaScript fails
linter.addRule({
name: 'JavaScript',
desc: 'JavaScript is one word. You write JavaScript, not javascripts or java script.',
test: function (spec, result) {
var javaScriptFails = spec.contains(/(java[\s\-]script|java[\s\-]*scripts)/);
if (Array.isArray(javaScriptFails)) {
result.addError(
'JavaScript is one word, and there\'s no "s" on the end',
javaScriptFails
);
result.addRecruiterFailPoints(javaScriptFails.length);
}
}
});
// Rails fails
linter.addRule({
name: 'Ruby On Rail',
desc: 'Ruby On Rails is plural – there is more than one rail.',
test: function (spec, result) {
var railsFails = spec.contains('ruby on rail');
if (Array.isArray(railsFails)) {
result.addError(
'Ruby On Rails is plural – there is more than one rail.',
railsFails
);
result.addRecruiterFailPoints(railsFails.length);
}
}
});
}