Skip to content

Commit

Permalink
feat: drop pinning flag
Browse files Browse the repository at this point in the history
  • Loading branch information
lili2311 committed Dec 24, 2019
1 parent 74a6c33 commit 3a0a1ce
Show file tree
Hide file tree
Showing 3 changed files with 2 additions and 13 deletions.
8 changes: 1 addition & 7 deletions src/cli/commands/test/formatters/legacy-format-issue.ts
Original file line number Diff line number Diff line change
Expand Up @@ -46,11 +46,7 @@ export function formatIssues(
extraInfo: vuln.note ? chalk.bold('\n Note: ' + vuln.note) : '',
remediationInfo:
vuln.metadata.type !== 'license' && localPackageTest
? createRemediationText(
vuln,
packageManager,
!!options.pinningSupported,
)
? createRemediationText(vuln, packageManager)
: '',
fixedIn: options.docker ? createFixedInText(vuln) : '',
dockerfilePackage: options.docker ? dockerfileInstructionText(vuln) : '',
Expand Down Expand Up @@ -174,15 +170,13 @@ function createFixedInText(vuln: GroupedVuln): string {
function createRemediationText(
vuln: GroupedVuln,
packageManager: SupportedPackageManagers,
pinningSupported: boolean,
): string {
let wizardHintText = '';
if (WIZARD_SUPPORTED_PACKAGE_MANAGERS.includes(packageManager)) {
wizardHintText = 'Run `snyk wizard` to explore remediation options.';
}

if (
pinningSupported &&
vuln.fixedIn &&
PINNING_SUPPORTED_PACKAGE_MANAGERS.includes(packageManager)
) {
Expand Down
6 changes: 1 addition & 5 deletions src/cli/commands/test/index.ts
Original file line number Diff line number Diff line change
Expand Up @@ -183,14 +183,10 @@ async function test(...args: MethodArgs): Promise<string> {
throw err;
}

const pipResults: LegacyVulnApiResult = results.find(
const pinningSupported: LegacyVulnApiResult = results.find(
(res) => res.packageManager === 'pip',
);

const pinningSupported =
pipResults &&
(await isFeatureFlagSupportedForOrg('pythonPinningAdvice', config.org)).ok;

let response = results
.map((unused, i) => {
resultOptions[i].pinningSupported = pinningSupported;
Expand Down
1 change: 0 additions & 1 deletion src/lib/types.ts
Original file line number Diff line number Diff line change
Expand Up @@ -29,7 +29,6 @@ export interface TestOptions {
interactive: boolean;
'prune-repeated-subdependencies'?: boolean;
showVulnPaths: ShowVulnPaths;
pinningSupported?: boolean;
failOn?: FailOn;
}
export interface ProtectOptions {
Expand Down

0 comments on commit 3a0a1ce

Please sign in to comment.