From 07bc83247cd6c057088da51afa31c573c290d399 Mon Sep 17 00:00:00 2001 From: yangfan <18767120422@163.com> Date: Wed, 3 Nov 2021 14:37:37 +0800 Subject: [PATCH] feat: init --- extensions/doctor/CHANGELOG.md | 4 ++++ extensions/doctor/package.json | 2 +- extensions/doctor/src/codemod.ts | 10 ++++++++-- 3 files changed, 13 insertions(+), 3 deletions(-) diff --git a/extensions/doctor/CHANGELOG.md b/extensions/doctor/CHANGELOG.md index 102dd8b44..853deb391 100644 --- a/extensions/doctor/CHANGELOG.md +++ b/extensions/doctor/CHANGELOG.md @@ -1,5 +1,9 @@ # Change Log +# 1.1.7 + +- feat: only check codemod for rax and ice project + # 1.1.6 - feat: add showInformationMessage for codemod result diff --git a/extensions/doctor/package.json b/extensions/doctor/package.json index 31e3512c5..6a7a0a1ae 100644 --- a/extensions/doctor/package.json +++ b/extensions/doctor/package.json @@ -3,7 +3,7 @@ "displayName": "Doctor", "description": "A free security and quality audit tool for modern DevOps teams", "publisher": "iceworks-team", - "version": "1.1.6", + "version": "1.1.7", "engines": { "vscode": "^1.41.0" }, diff --git a/extensions/doctor/src/codemod.ts b/extensions/doctor/src/codemod.ts index 4ebd95b7b..35c2a016b 100644 --- a/extensions/doctor/src/codemod.ts +++ b/extensions/doctor/src/codemod.ts @@ -3,7 +3,7 @@ import * as path from 'path'; import * as vscode from 'vscode'; import * as semver from 'semver'; import { Doctor } from '@appworks/doctor'; -import { projectPath } from '@appworks/project-service'; +import { projectPath, getProjectFramework } from '@appworks/project-service'; import parse from 'parse-package-name'; import setOutput from './setOutput'; import setDeprecatedPackage from './setDeprecatedPackage'; @@ -34,8 +34,14 @@ export async function activateCodemod(context: vscode.ExtensionContext) { const packageFile = path.join(projectPath, 'package.json'); const packageJSON = fs.existsSync(packageFile) ? JSON.parse(fs.readFileSync(packageFile, 'utf-8')) : {}; + const projectFramework = await getProjectFramework(); + // Show notifaction - if (fs.existsSync(packageFile) && projectPath) { + if ( + fs.existsSync(packageFile) && projectPath && + // Only check for rax and ice project + projectFramework !== 'unknown' && projectFramework !== 'vue' + ) { const reports = await doctor.scan(projectPath, SCAN_OPTIONS); (reports.codemod?.reports || []).forEach((codemod) => { if (codemod.severity > 0) {