mirror of
https://gitee.com/openharmony/interface_sdk-js
synced 2024-11-23 07:10:52 +00:00
kit file告警过滤bug修复,any关键字校验范围调整
Signed-off-by: fanjiaojiao0729 <fanjiaojiao@huawei.com>
This commit is contained in:
parent
c51c5e5363
commit
863e613828
@ -127,7 +127,7 @@ export class Check {
|
||||
errorBaseInfo);
|
||||
AddErrorLogs.addAPICheckErrorLogs(apiInfoNojsdoc, compositiveResult, compositiveLocalResult);
|
||||
} else {
|
||||
if (apiJsdoc.getKit().length === 0) {
|
||||
if (apiJsdoc.getKit() === 'NA') {
|
||||
const errorBaseInfo: ErrorBaseInfo = new ErrorBaseInfo();
|
||||
errorBaseInfo
|
||||
.setErrorID(ErrorID.WRONG_SCENE_ID)
|
||||
|
@ -62,11 +62,12 @@ export class AddErrorLogs {
|
||||
|
||||
checkErrorInfos.forEach((checkErrorInfo: ApiResultSimpleInfo) => {
|
||||
const checkErrorMessage: string = checkErrorInfo.getMessage().replace(/API check error of \[.*\]: /g, '');
|
||||
if (checkErrorMessage === CommonFunctions.createErrorInfo(ErrorMessage.ERROR_LOST_LABEL, ['kit'])) {
|
||||
hasLostKitErrorInfo.push(checkErrorInfo.getMessage());
|
||||
const keyMessage: string = checkErrorInfo.getFilePath() + checkErrorMessage;
|
||||
if (keyMessage === apiInfo.getFilePath() + CommonFunctions.createErrorInfo(ErrorMessage.ERROR_LOST_LABEL, ['kit'])) {
|
||||
hasLostKitErrorInfo.push(checkErrorInfo.getFilePath() + checkErrorInfo.getMessage());
|
||||
}
|
||||
if (checkErrorMessage === CommonFunctions.createErrorInfo(ErrorMessage.ERROR_LOST_LABEL, ['file'])) {
|
||||
hasLostfileErrorInfo.push(checkErrorInfo.getMessage());
|
||||
if (keyMessage === apiInfo.getFilePath() + CommonFunctions.createErrorInfo(ErrorMessage.ERROR_LOST_LABEL, ['file'])) {
|
||||
hasLostfileErrorInfo.push(checkErrorInfo.getFilePath() + checkErrorInfo.getMessage());
|
||||
}
|
||||
});
|
||||
if ((isLostKitErrorInfo && hasLostKitErrorInfo.length !== 0) ||
|
||||
|
@ -26,7 +26,8 @@ export class ForbiddenWordsCheck {
|
||||
* @returns { ErrorTagFormat }
|
||||
*/
|
||||
static forbiddenWordsCheck(singleApi: ClassInfo): ErrorTagFormat {
|
||||
const forbiddenWordsArr: string[] = ['any', 'this', 'unknown'];
|
||||
const forbiddenWordsArr: string[] = ['this', 'unknown'];
|
||||
const forbiddenWordAny: string = 'any';
|
||||
const forbiddenWordsResult: ErrorTagFormat = {
|
||||
state: true,
|
||||
errorInfo: '',
|
||||
@ -46,7 +47,8 @@ export class ForbiddenWordsCheck {
|
||||
});
|
||||
let apiTextWordsArr = fullText.split(/\s/g);
|
||||
apiTextWordsArr.forEach((apiTextWord) => {
|
||||
if (forbiddenWordsArr.includes(apiTextWord) && publishVersion === apiVersionToBeVerified) {
|
||||
|
||||
if (publishVersion === apiVersionToBeVerified && (forbiddenWordsArr.includes(apiTextWord) || (apiTextWord === forbiddenWordAny && singleApi.getFilePath().indexOf('.d.ets') !== -1))) {
|
||||
forbiddenWordsResult.state = false;
|
||||
forbiddenWordsResult.errorInfo = CommonFunctions.createErrorInfo(ErrorMessage.ILLEGAL_USE_ANY, [apiTextWord]);
|
||||
}
|
||||
|
Loading…
Reference in New Issue
Block a user