qa-control 0.4.20 → 0.5.0-rc.0
This diff represents the content of publicly available package versions that have been released to one of the supported registries. The information contained in this diff is provided for informational purposes only and reflects changes between package versions as they appear in their respective public registries.
- package/bin/0.1.3/definition.js +13 -4
- package/bin/0.1.4/definition.js +13 -4
- package/bin/0.2.0/definition.js +17 -8
- package/bin/0.3.0/definition.js +16 -7
- package/bin/qa-control.js +1 -1
- package/bin/qac-init.js +3 -3
- package/package.json +12 -12
package/bin/0.1.3/definition.js
CHANGED
|
@@ -4,6 +4,15 @@ var stripBom = require("strip-bom-string");
|
|
|
4
4
|
var semver = require("semver");
|
|
5
5
|
var jsh = require('jshint');
|
|
6
6
|
var esl = require('eslint');
|
|
7
|
+
var eslintLinter = new esl.Linter();
|
|
8
|
+
function eslintrcToFlatConfig(rc) {
|
|
9
|
+
var flat = {};
|
|
10
|
+
if (rc.rules) { flat.rules = rc.rules; }
|
|
11
|
+
var sourceType = (rc.env && rc.env.node) ? 'commonjs' : 'script';
|
|
12
|
+
flat.languageOptions = { ecmaVersion: 'latest', sourceType: sourceType };
|
|
13
|
+
flat.linterOptions = { reportUnusedDisableDirectives: 'off' };
|
|
14
|
+
return flat;
|
|
15
|
+
}
|
|
7
16
|
var multilang = require('multilang');
|
|
8
17
|
var fs = require('fs-promise');
|
|
9
18
|
var Path = require('path');
|
|
@@ -589,13 +598,13 @@ module.exports = function(qaControl){
|
|
|
589
598
|
checks:[{
|
|
590
599
|
warnings:function(info){
|
|
591
600
|
var warns = [];
|
|
592
|
-
var eslintOpts =
|
|
593
|
-
info.packageJson.eslintConfig ||
|
|
594
|
-
qaControl.projectDefinition[info.packageVersion].eslint_options;
|
|
601
|
+
var eslintOpts = eslintrcToFlatConfig(
|
|
602
|
+
info.packageJson.eslintConfig ||
|
|
603
|
+
qaControl.projectDefinition[info.packageVersion].eslint_options);
|
|
595
604
|
for(var file in info.files) {
|
|
596
605
|
if(file.match(/(.js)$/)) {
|
|
597
606
|
var content = info.files[file].content;
|
|
598
|
-
var data =
|
|
607
|
+
var data = eslintLinter.verify(content, eslintOpts);
|
|
599
608
|
if(data.length) {
|
|
600
609
|
if(qaControl.verbose){
|
|
601
610
|
console.log('ESLINT output:');
|
package/bin/0.1.4/definition.js
CHANGED
|
@@ -4,6 +4,15 @@ var stripBom = require("strip-bom-string");
|
|
|
4
4
|
var semver = require("semver");
|
|
5
5
|
var jsh = require('jshint');
|
|
6
6
|
var esl = require('eslint');
|
|
7
|
+
var eslintLinter = new esl.Linter();
|
|
8
|
+
function eslintrcToFlatConfig(rc) {
|
|
9
|
+
var flat = {};
|
|
10
|
+
if (rc.rules) { flat.rules = rc.rules; }
|
|
11
|
+
var sourceType = (rc.env && rc.env.node) ? 'commonjs' : 'script';
|
|
12
|
+
flat.languageOptions = { ecmaVersion: 'latest', sourceType: sourceType };
|
|
13
|
+
flat.linterOptions = { reportUnusedDisableDirectives: 'off' };
|
|
14
|
+
return flat;
|
|
15
|
+
}
|
|
7
16
|
var multilang = require('multilang');
|
|
8
17
|
var fs = require('fs-promise');
|
|
9
18
|
var Path = require('path');
|
|
@@ -590,13 +599,13 @@ module.exports = function(qaControl){
|
|
|
590
599
|
checks:[{
|
|
591
600
|
warnings:function(info){
|
|
592
601
|
var warns = [];
|
|
593
|
-
var eslintOpts =
|
|
594
|
-
info.packageJson.eslintConfig ||
|
|
595
|
-
qaControl.projectDefinition[info.packageVersion].eslint_options;
|
|
602
|
+
var eslintOpts = eslintrcToFlatConfig(
|
|
603
|
+
info.packageJson.eslintConfig ||
|
|
604
|
+
qaControl.projectDefinition[info.packageVersion].eslint_options);
|
|
596
605
|
for(var file in info.files) {
|
|
597
606
|
if(file.match(/(.js)$/)) {
|
|
598
607
|
var content = info.files[file].content;
|
|
599
|
-
var data =
|
|
608
|
+
var data = eslintLinter.verify(content, eslintOpts);
|
|
600
609
|
if(data.length) {
|
|
601
610
|
if(qaControl.verbose){
|
|
602
611
|
console.log('ESLINT output:');
|
package/bin/0.2.0/definition.js
CHANGED
|
@@ -4,6 +4,15 @@ var stripBom = require("strip-bom-string");
|
|
|
4
4
|
var semver = require("semver");
|
|
5
5
|
var jsh = require('jshint');
|
|
6
6
|
var esl = require('eslint');
|
|
7
|
+
var eslintLinter = new esl.Linter();
|
|
8
|
+
function eslintrcToFlatConfig(rc) {
|
|
9
|
+
var flat = {};
|
|
10
|
+
if (rc.rules) { flat.rules = rc.rules; }
|
|
11
|
+
var sourceType = (rc.env && rc.env.node) ? 'commonjs' : 'script';
|
|
12
|
+
flat.languageOptions = { ecmaVersion: 'latest', sourceType: sourceType };
|
|
13
|
+
flat.linterOptions = { reportUnusedDisableDirectives: 'off' };
|
|
14
|
+
return flat;
|
|
15
|
+
}
|
|
7
16
|
var multilang = require('multilang');
|
|
8
17
|
var fs = require('fs-promise');
|
|
9
18
|
var Path = require('path');
|
|
@@ -190,7 +199,7 @@ module.exports = function(qaControl){
|
|
|
190
199
|
}
|
|
191
200
|
},
|
|
192
201
|
// Si info.scoring == true, cada regla debe agregar junto al warning, un objeto 'scoring'
|
|
193
|
-
// con na o m�s de las siguientes propiedades:
|
|
202
|
+
// con na o m�s de las siguientes propiedades:
|
|
194
203
|
// qac: 1
|
|
195
204
|
// mandatories: 1
|
|
196
205
|
// cucardas:1
|
|
@@ -201,7 +210,7 @@ module.exports = function(qaControl){
|
|
|
201
210
|
// customs:1
|
|
202
211
|
// jshint:1
|
|
203
212
|
// dependencies:1
|
|
204
|
-
// Emilio redefinir� valores de cada score
|
|
213
|
+
// Emilio redefinir� valores de cada score
|
|
205
214
|
rules:{
|
|
206
215
|
exist_package_json:{
|
|
207
216
|
checks:[{
|
|
@@ -349,7 +358,7 @@ module.exports = function(qaControl){
|
|
|
349
358
|
return warns;
|
|
350
359
|
}
|
|
351
360
|
}]
|
|
352
|
-
}, // agregar desde ac�
|
|
361
|
+
}, // agregar desde ac�
|
|
353
362
|
no_test_in_node_four:{
|
|
354
363
|
checks:[{
|
|
355
364
|
warnings:function(info){
|
|
@@ -414,7 +423,7 @@ module.exports = function(qaControl){
|
|
|
414
423
|
}
|
|
415
424
|
if(readme.indexOf(cucaStr) === -1) {
|
|
416
425
|
// si tengo cucarda mal formada, devuelvo warning aunque no sea obligatoria
|
|
417
|
-
// porque existi� la intenci�n de definirla
|
|
426
|
+
// porque existi� la intenci�n de definirla
|
|
418
427
|
warns.push({warning:'wrong_format_in_cucarda_1', params:[nombreCucarda], scoring:{cucardas:1}});
|
|
419
428
|
}
|
|
420
429
|
}
|
|
@@ -590,13 +599,13 @@ module.exports = function(qaControl){
|
|
|
590
599
|
checks:[{
|
|
591
600
|
warnings:function(info){
|
|
592
601
|
var warns = [];
|
|
593
|
-
var eslintOpts =
|
|
594
|
-
info.packageJson.eslintConfig ||
|
|
595
|
-
qaControl.projectDefinition[info.packageVersion].eslint_options;
|
|
602
|
+
var eslintOpts = eslintrcToFlatConfig(
|
|
603
|
+
info.packageJson.eslintConfig ||
|
|
604
|
+
qaControl.projectDefinition[info.packageVersion].eslint_options);
|
|
596
605
|
for(var file in info.files) {
|
|
597
606
|
if(file.match(/(.js)$/)) {
|
|
598
607
|
var content = info.files[file].content;
|
|
599
|
-
var data =
|
|
608
|
+
var data = eslintLinter.verify(content, eslintOpts);
|
|
600
609
|
if(data.length) {
|
|
601
610
|
if(qaControl.verbose){
|
|
602
611
|
console.log('ESLINT output:');
|
package/bin/0.3.0/definition.js
CHANGED
|
@@ -4,6 +4,15 @@ var stripBom = require("strip-bom-string");
|
|
|
4
4
|
var semver = require("semver");
|
|
5
5
|
var jsh = require('jshint');
|
|
6
6
|
var esl = require('eslint');
|
|
7
|
+
var eslintLinter = new esl.Linter();
|
|
8
|
+
function eslintrcToFlatConfig(rc) {
|
|
9
|
+
var flat = {};
|
|
10
|
+
if (rc.rules) { flat.rules = rc.rules; }
|
|
11
|
+
var sourceType = (rc.env && rc.env.node) ? 'commonjs' : 'script';
|
|
12
|
+
flat.languageOptions = { ecmaVersion: 'latest', sourceType: sourceType };
|
|
13
|
+
flat.linterOptions = { reportUnusedDisableDirectives: 'off' };
|
|
14
|
+
return flat;
|
|
15
|
+
}
|
|
7
16
|
var multilang = require('multilang');
|
|
8
17
|
var fs = require('fs-promise');
|
|
9
18
|
var Path = require('path');
|
|
@@ -194,7 +203,7 @@ module.exports = function(qaControl){
|
|
|
194
203
|
}
|
|
195
204
|
},
|
|
196
205
|
// Si info.scoring == true, cada regla debe agregar junto al warning, un objeto 'scoring'
|
|
197
|
-
// con na o m�s de las siguientes propiedades:
|
|
206
|
+
// con na o m�s de las siguientes propiedades:
|
|
198
207
|
// qac: 1
|
|
199
208
|
// mandatories: 1
|
|
200
209
|
// cucardas:1
|
|
@@ -205,7 +214,7 @@ module.exports = function(qaControl){
|
|
|
205
214
|
// customs:1
|
|
206
215
|
// jshint:1
|
|
207
216
|
// dependencies:1
|
|
208
|
-
// Emilio redefinir� valores de cada score
|
|
217
|
+
// Emilio redefinir� valores de cada score
|
|
209
218
|
rules:{
|
|
210
219
|
exist_package_json:{
|
|
211
220
|
checks:[{
|
|
@@ -353,7 +362,7 @@ module.exports = function(qaControl){
|
|
|
353
362
|
return warns;
|
|
354
363
|
}
|
|
355
364
|
}]
|
|
356
|
-
}, // agregar desde ac�
|
|
365
|
+
}, // agregar desde ac�
|
|
357
366
|
no_test_in_last_node:{
|
|
358
367
|
checks:[{
|
|
359
368
|
warnings:function(info){
|
|
@@ -418,7 +427,7 @@ module.exports = function(qaControl){
|
|
|
418
427
|
}
|
|
419
428
|
if(readme.indexOf(cucaStr) === -1) {
|
|
420
429
|
// si tengo cucarda mal formada, devuelvo warning aunque no sea obligatoria
|
|
421
|
-
// porque existi� la intenci�n de definirla
|
|
430
|
+
// porque existi� la intenci�n de definirla
|
|
422
431
|
warns.push({warning:'wrong_format_in_cucarda_1', params:[nombreCucarda], scoring:{cucardas:1}});
|
|
423
432
|
}
|
|
424
433
|
}
|
|
@@ -566,11 +575,11 @@ module.exports = function(qaControl){
|
|
|
566
575
|
checks:[{
|
|
567
576
|
warnings:function(info){
|
|
568
577
|
var warns = [];
|
|
569
|
-
var eslintOpts = yaml.
|
|
578
|
+
var eslintOpts = eslintrcToFlatConfig(yaml.load(info.files['.eslintrc.yml'].content));
|
|
570
579
|
for(var file in info.files) {
|
|
571
580
|
if(file.match(/(.js)$/)) {
|
|
572
581
|
var content = info.files[file].content;
|
|
573
|
-
var data =
|
|
582
|
+
var data = eslintLinter.verify(content, eslintOpts);
|
|
574
583
|
if(data.length) {
|
|
575
584
|
if(qaControl.verbose){
|
|
576
585
|
console.log('ESLINT output:');
|
|
@@ -714,7 +723,7 @@ module.exports = function(qaControl){
|
|
|
714
723
|
checks:[{
|
|
715
724
|
warnings:function(info) {
|
|
716
725
|
var warns = [];
|
|
717
|
-
var travisYML = yaml.
|
|
726
|
+
var travisYML = yaml.load(info.files['.travis.yml'].content);
|
|
718
727
|
var mandatories = travisYML.node_js;
|
|
719
728
|
var optionals = travisYML.matrix.allow_failures;
|
|
720
729
|
var versions=[{num:'4'},{num:'6'} ,{num:7, optional:true}];
|
package/bin/qa-control.js
CHANGED
|
@@ -323,7 +323,7 @@ qaControl.loadProject = function loadProject(projectDir) {
|
|
|
323
323
|
}
|
|
324
324
|
}).then(function() {
|
|
325
325
|
if(info.files['.travis.yml']){
|
|
326
|
-
info.dotTravis = yaml.
|
|
326
|
+
info.dotTravis = yaml.load(info.files['.travis.yml'].content);
|
|
327
327
|
}
|
|
328
328
|
});
|
|
329
329
|
}).then(function() {
|
package/bin/qac-init.js
CHANGED
|
@@ -150,13 +150,13 @@ qacInit.readParameters = function readParameters(inputParams, params) {
|
|
|
150
150
|
});
|
|
151
151
|
});
|
|
152
152
|
return cadenaDePromesas.then(function() {
|
|
153
|
-
process.stdin.
|
|
153
|
+
process.stdin.destroy();
|
|
154
154
|
params.forEach(function(param) {
|
|
155
155
|
if(param.temporary) { delete ctx.result[param.name]; }
|
|
156
156
|
});
|
|
157
|
-
return ctx.result;
|
|
157
|
+
return ctx.result;
|
|
158
158
|
}).catch(function(err) {
|
|
159
|
-
process.stdin.
|
|
159
|
+
process.stdin.destroy();
|
|
160
160
|
//console.log("err.stack", err.stack)
|
|
161
161
|
throw { message:'input_error', desc:err };
|
|
162
162
|
});
|
package/package.json
CHANGED
|
@@ -1,7 +1,7 @@
|
|
|
1
1
|
{
|
|
2
2
|
"name": "qa-control",
|
|
3
3
|
"description": "QA control of things that nobody controls",
|
|
4
|
-
"version": "0.
|
|
4
|
+
"version": "0.5.0-rc.0",
|
|
5
5
|
"author": "Codenautas <codenautas@googlegroups.com>",
|
|
6
6
|
"license": "MIT",
|
|
7
7
|
"repository": "codenautas/qa-control",
|
|
@@ -20,23 +20,23 @@
|
|
|
20
20
|
},
|
|
21
21
|
"main": "./bin/qa-control.js",
|
|
22
22
|
"dependencies": {
|
|
23
|
-
"commander": "~
|
|
24
|
-
"eslint": "~
|
|
25
|
-
"fs-extra": "~
|
|
23
|
+
"commander": "~14.0.3",
|
|
24
|
+
"eslint": "~10.3.0",
|
|
25
|
+
"fs-extra": "~11.3.5",
|
|
26
26
|
"fs-promise": "~2.0.3",
|
|
27
|
-
"js-yaml": "~
|
|
28
|
-
"jshint": "~2.
|
|
29
|
-
"parameters": "~0.
|
|
30
|
-
"semver": "~
|
|
27
|
+
"js-yaml": "~4.1.1",
|
|
28
|
+
"jshint": "~2.13.6",
|
|
29
|
+
"parameters": "~0.8.1",
|
|
30
|
+
"semver": "~7.8.0",
|
|
31
31
|
"strip-bom-string": "~1.0.0",
|
|
32
|
-
"best-globals": "~
|
|
33
|
-
"multilang": "~1.0
|
|
32
|
+
"best-globals": "~2.1.3",
|
|
33
|
+
"multilang": "~1.2.0"
|
|
34
34
|
},
|
|
35
35
|
"devDependencies": {
|
|
36
36
|
"expect.js": "~0.3.1",
|
|
37
37
|
"istanbul": "~0.4.5",
|
|
38
|
-
"mocha": "~
|
|
39
|
-
"sinon": "~
|
|
38
|
+
"mocha": "~11.7.5",
|
|
39
|
+
"sinon": "~22.0.0",
|
|
40
40
|
"expect-called": "~0.4.0"
|
|
41
41
|
},
|
|
42
42
|
"engines": {
|