Skip to content

Commit

Permalink
feat: init (#969)
Browse files Browse the repository at this point in the history
  • Loading branch information
fyangstudio authored Nov 5, 2021
1 parent 0b1c76e commit 594c220
Show file tree
Hide file tree
Showing 3 changed files with 13 additions and 3 deletions.
4 changes: 4 additions & 0 deletions extensions/doctor/CHANGELOG.md
Original file line number Diff line number Diff line change
@@ -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
Expand Down
2 changes: 1 addition & 1 deletion extensions/doctor/package.json
Original file line number Diff line number Diff line change
Expand Up @@ -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"
},
Expand Down
10 changes: 8 additions & 2 deletions extensions/doctor/src/codemod.ts
Original file line number Diff line number Diff line change
Expand Up @@ -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';
Expand Down Expand Up @@ -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) {
Expand Down

0 comments on commit 594c220

Please sign in to comment.