crabatool 1.0.196 → 1.0.197
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/package.json +1 -1
- package/tool/checkgspx.js +1 -1
- package/tool/checkjs.js +4 -4
package/package.json
CHANGED
package/tool/checkgspx.js
CHANGED
|
@@ -44,7 +44,7 @@ function readGspxToJSON(fileName, data) {
|
|
|
44
44
|
var level = 0;
|
|
45
45
|
fileName = fileName.replace(config.webPath, ''); // 简化文件路径
|
|
46
46
|
|
|
47
|
-
if (!byte.toString().startsWith('<?xml')) {
|
|
47
|
+
if (!byte.toString().trim().startsWith('<?xml')) {
|
|
48
48
|
data.errorList.push({ fileName: fileName, tag: '', error: 'gspx文件第一行必须是:<?xml version="1.0" encoding="UTF-8"?>' });
|
|
49
49
|
}
|
|
50
50
|
|
package/tool/checkjs.js
CHANGED
|
@@ -219,7 +219,7 @@ module.exports.start = async function() {
|
|
|
219
219
|
|
|
220
220
|
// 输出到钉钉的简易报告
|
|
221
221
|
//if (errKeys.length > 0) {
|
|
222
|
-
webhookList.push(`1. 语法异常文件数Error:${errKeys.length}个,占比${calc(errKeys.length, jsFiles.length)}`);
|
|
222
|
+
webhookList.push(`1. js语法异常文件数Error:${errKeys.length}个,占比${calc(errKeys.length, jsFiles.length)}`);
|
|
223
223
|
|
|
224
224
|
// 随机显示5个异常文件到钉钉消息
|
|
225
225
|
var errCount = errKeys.length;
|
|
@@ -241,9 +241,9 @@ module.exports.start = async function() {
|
|
|
241
241
|
|
|
242
242
|
//}
|
|
243
243
|
//if (warnKeys.length > 0) {
|
|
244
|
-
webhookList.push(`7. 语法警告文件数Warn:${warnKeys.length}个,占比${calc(warnKeys.length, jsFiles.length)}`);
|
|
244
|
+
webhookList.push(`7. js语法警告文件数Warn:${warnKeys.length}个,占比${calc(warnKeys.length, jsFiles.length)}`);
|
|
245
245
|
//}
|
|
246
|
-
webhookList.push(`8. 语法提示文件数Info:${infoKeys.length}个,占比${calc(infoKeys.length, jsFiles.length)}`);
|
|
246
|
+
webhookList.push(`8. js语法提示文件数Info:${infoKeys.length}个,占比${calc(infoKeys.length, jsFiles.length)}`);
|
|
247
247
|
|
|
248
248
|
if (config.checkutf8 && notUtf8List.length > 0) {
|
|
249
249
|
webhookList.push(`1. 非utf8文件数:${notUtf8List.length}个,占比${calc(notUtf8List.length, jsFiles.length)}`);
|
|
@@ -338,7 +338,7 @@ module.exports.start = async function() {
|
|
|
338
338
|
if (gspxData.errorList.length > 0) {
|
|
339
339
|
detail.push(`# 出错gspx页面清单如下`);
|
|
340
340
|
gspxData.errorList.forEach((info, index) => {
|
|
341
|
-
detail.push(`${index + 1}. ${info.
|
|
341
|
+
detail.push(`${index + 1}. ${info.fileName}`);
|
|
342
342
|
detail.push(`> 错误标签: ${info.tag}`);
|
|
343
343
|
detail.push(`> 错误描述:${info.error}`);
|
|
344
344
|
});
|