crabatool 1.0.200 → 1.0.203

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/lib/utils.js CHANGED
@@ -431,7 +431,9 @@ class Utils {
431
431
  });
432
432
  }
433
433
 
434
- if (!fileList) fileList = [];
434
+ if (!fileList) {
435
+ fileList = [];
436
+ }
435
437
 
436
438
  if (!fs.existsSync(source)) {
437
439
  return fileList;
@@ -440,7 +442,8 @@ class Utils {
440
442
  var files = fs.readdirSync(source);
441
443
  files.forEach(function(fileName) {
442
444
  var filePath = utils.join(source, fileName);
443
- if (options.ignores && options.ignores.includes(filePath)) {
445
+ // 包含路径或文件名,都忽略掉
446
+ if (options.ignores && (options.ignores.includes(filePath) || options.ignores.includes(fileName))) {
444
447
  return;
445
448
  }
446
449
 
package/package.json CHANGED
@@ -1,6 +1,6 @@
1
1
  {
2
2
  "name": "crabatool",
3
- "version": "1.0.200",
3
+ "version": "1.0.203",
4
4
  "description": "crabatool",
5
5
  "main": "index.js",
6
6
  "bin": {
package/tool/checkjs.js CHANGED
@@ -275,7 +275,7 @@ module.exports.start = async function() {
275
275
  detail.push("| ----- | ------ | ---- | ---- |");
276
276
  infoList.forEach((item) => {
277
277
  detail.push(`| ${item.char.trim()} | ${item.line || '-'} | ${item.column || '-'} | ${item.msg || '-'} |`);
278
- sonar.issues.push(getSonarEntity('语法异常', modName, item.char.trim(), fileName, -1, item.line, item.column, item.endLine));
278
+ sonar.issues.push(getSonarEntity('语法异常', modName, item.char.trim(), fileName, item.line, item.column, item.endLine));
279
279
  });
280
280
  });
281
281
  //}
@@ -292,7 +292,7 @@ module.exports.start = async function() {
292
292
  detail.push("| ----- | ------ | ---- | ---- |");
293
293
  infoList.forEach((item) => {
294
294
  detail.push(`| ${item.char.trim()} | ${item.line || '-'} | ${item.column || '-'} | ${item.msg || '-'} |`);
295
- sonar.issues.push(getSonarEntity('语法警告', modName, item.char.trim(), fileName, -1, item.line, item.column, item.endLine));
295
+ sonar.issues.push(getSonarEntity('语法警告', modName, item.char.trim(), fileName, item.line, item.column, item.endLine));
296
296
  });
297
297
  });
298
298
  //}
@@ -310,7 +310,7 @@ module.exports.start = async function() {
310
310
  detail.push("| ----- | ------ | ---- | ---- |");
311
311
  infoList.forEach((item) => {
312
312
  detail.push(`| ${item.char.trim()} | ${item.line || '-'} | ${item.column || '-'} | ${item.msg || '-'} |`);
313
- sonar.issues.push(getSonarEntity('语法提示', modName, item.char.trim(), fileName, -1, item.line, item.column, item.endLine));
313
+ sonar.issues.push(getSonarEntity('语法提示', modName, item.char.trim(), fileName, item.line, item.column, item.endLine));
314
314
  });
315
315
  });
316
316
  //}
@@ -321,7 +321,7 @@ module.exports.start = async function() {
321
321
  notUtf8List.forEach((s, index) => {
322
322
  detail.push(`${index + 1}. ${s}`);
323
323
 
324
- sonar.issues.push(getSonarEntity('非utf8', modName, '', s, -1, -1));
324
+ sonar.issues.push(getSonarEntity('非utf8', modName, '', s, -1, -1,-1));
325
325
  });
326
326
  }
327
327
 
@@ -480,7 +480,10 @@ function getSonarEntity(type, modName, message, filePath, line, column, endLine)
480
480
  }
481
481
 
482
482
  function getReportUrl(id, anchor) {
483
- if (!config.reportHost) return '';
483
+ if (!config.reportHost) {
484
+ return '';
485
+ }
486
+
484
487
  var href = config.reportHost + "/index.html#%2FPages%2FReport%2FJsReport.gspx?id=" + id;
485
488
  if (anchor) {
486
489
  href += "&toc=anchor-" + anchor;
@@ -538,7 +541,10 @@ function postWebhooks(id, reportUrl, webhookList) {
538
541
  return;
539
542
  }
540
543
 
541
- if (reportUrl) webhookList.push(`[报告详情](${reportUrl})`);
544
+ if (reportUrl) {
545
+ webhookList.push(`[报告详情](${reportUrl})`);
546
+ webhookList.push("[导出excel](" + config.reportHost + "/apis/downloadReport?id=" + id + ")");
547
+ }
542
548
  var content = webhookList.join(' \n');// 推送到钉钉只推送详情
543
549
 
544
550
  var data = {
@@ -74,6 +74,7 @@ function doUploadCraba(version) {
74
74
  data: formData,
75
75
  headers: {
76
76
  ...headers,
77
+ craba: 1,
77
78
  version: version,
78
79
  token: 'wssf2021' // 临时授权码
79
80
  }