qa-control 0.6.10 → 0.6.12

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.
@@ -0,0 +1,11 @@
1
+ name: Build and test
2
+
3
+ on:
4
+ push:
5
+ branches: [master]
6
+ pull_request:
7
+ branches: [master]
8
+
9
+ jobs:
10
+ ci:
11
+ uses: codenautas/.github/.github/workflows/node-build-and-test.yaml@v1
@@ -0,0 +1,16 @@
1
+ name: Publish from Tag
2
+
3
+ on:
4
+ push:
5
+ tags:
6
+ - 'v[0-9]+.[0-9]*'
7
+
8
+ permissions:
9
+ id-token: write
10
+ contents: read
11
+
12
+ jobs:
13
+ publish:
14
+ uses: codenautas/.github/.github/workflows/npm-publish-from-tag.yaml@v1
15
+ with:
16
+ node_version: '24'
@@ -0,0 +1,11 @@
1
+ name: QA control
2
+
3
+ on:
4
+ push:
5
+ branches: [master]
6
+ pull_request:
7
+ branches: [master]
8
+
9
+ jobs:
10
+ qa:
11
+ uses: codenautas/.github/.github/workflows/qa-control.yaml@v1
@@ -332,7 +332,7 @@ module.exports = function(qaControl){
332
332
  }else{
333
333
  var observedValue=qaControlSection[sectionName];
334
334
  if(sectionDef.values && !(observedValue in sectionDef.values)){
335
- warns.push({warning:'invalid_value_1_in_parameter_2',params:[observedValue,sectionName], scoring:{warnings:1}});
335
+ warns.push({warning:'invalid_value_1_in_parameter_2_valid_values_3',params:[observedValue,sectionName,Object.keys(sectionDef.values).join(', ')], scoring:{warnings:1}});
336
336
  }
337
337
  }
338
338
  }
@@ -584,7 +584,7 @@ module.exports = function(qaControl){
584
584
  var file=obtainedLangs.langs[lang].fileName;
585
585
  if(file !== defReadme) {
586
586
  var mlContent = multilang.changeNamedDoc(file, content, lang);
587
- if(mlContent !== info.files[file].content) {
587
+ if(qaControl.fixEOL(mlContent) !== qaControl.fixEOL(info.files[file].content)) {
588
588
  warns.push({warning:'readme_multilang_not_sincronized_with_file_1', params:[file], scoring:{multilang:1}});
589
589
  }
590
590
  }
@@ -749,7 +749,7 @@ module.exports = function(qaControl){
749
749
  return Promise.all(qaFiles.map(function(fileName) {
750
750
  return fs.readFile(Path.join(qaWorkflowsDir, fileName), 'utf8').then(function(qaContent) {
751
751
  return fs.readFile(Path.join(projWorkflowsDir, fileName), 'utf8').then(function(projContent) {
752
- if(qaContent !== projContent) {
752
+ if(qaControl.fixEOL(qaContent) !== qaControl.fixEOL(projContent)) {
753
753
  return [{warning:'workflow_file_1_differs', params:[fileName], scoring:{workflows:1}}];
754
754
  }
755
755
  return [];
package/bin/qa-control.js CHANGED
@@ -5,6 +5,7 @@ var qaControl = {};
5
5
 
6
6
  var fs = require('fs-extra');
7
7
  var Path = require('path');
8
+ var os = require('os');
8
9
  var stripBom = require('strip-bom-string');
9
10
  var yaml = require('js-yaml');
10
11
  var semver = require("semver");
@@ -33,7 +34,7 @@ qaControl.msgs={
33
34
  },
34
35
  es:{
35
36
  deprecated_version: 'la version es demasiado vieja',
36
- invalid_value_1_in_parameter_2: 'valor invalido "$1" para el parametro "$2" en la sección qa-control',
37
+ invalid_value_1_in_parameter_2_valid_values_3: 'valor invalido "$1" para el parametro "$2" en la sección qa-control. Valores válidos: $3',
37
38
  lack_of_mandatory_file_1: 'falta el archivo obligatorio "$1"',
38
39
  //lack_of_mandatory_parameter_1: 'falta el parámetro obligatorio "$1"',
39
40
  lack_of_mandatory_section_1: 'falta la sección obligatoria "$1" en la sección qa-control',
@@ -102,7 +103,7 @@ qaControl.cmdMsgs = {
102
103
 
103
104
  // devuelve un buffer con los \n, \r\n, \r como \n
104
105
  qaControl.fixEOL = function fixEOL(buf) {
105
- return buf.replace(/\s*\r?\n/g, '\n').replace(/\s*\r/g, '\n');
106
+ return buf.replace(/[^\S\r\n]*(?:\r\n?|\n)/g, os.EOL);
106
107
  };
107
108
 
108
109
  // bufTest debe empezar con bufStart
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.6.10",
4
+ "version": "0.6.12",
5
5
  "author": "Codenautas <codenautas@googlegroups.com>",
6
6
  "license": "MIT",
7
7
  "repository": "codenautas/qa-control",
@@ -59,7 +59,8 @@
59
59
  "all": "npm test && npm run test-cov && npm run report && npm run qac"
60
60
  },
61
61
  "files": [
62
- "bin"
62
+ "bin",
63
+ ".github/workflows"
63
64
  ],
64
65
  "qa-control": {
65
66
  "package-version": "0.3.0",