Skip to content
New issue

Have a question about this project? Sign up for a free GitHub account to open an issue and contact its maintainers and the community.

By clicking “Sign up for GitHub”, you agree to our terms of service and privacy statement. We’ll occasionally send you account related emails.

Already on GitHub? Sign in to your account

feat: only check codemod for rax and ice project #969

Merged
merged 1 commit into from
Nov 5, 2021
Merged
Show file tree
Hide file tree
Changes from all commits
Commits
File filter

Filter by extension

Filter by extension


Conversations
Failed to load comments.
Loading
Jump to
Jump to file
Failed to load files.
Loading
Diff view
Diff view
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