Skip to content

Commit

Permalink
Merge pull request #713 from snyk/fix/wording-and-spacing
Browse files Browse the repository at this point in the history
Fix/wording and spacing
  • Loading branch information
Mila Votradovec committed Aug 7, 2019
2 parents e24f277 + b081226 commit 9a95a78
Show file tree
Hide file tree
Showing 6 changed files with 22 additions and 22 deletions.
2 changes: 1 addition & 1 deletion help/help.txt
Original file line number Diff line number Diff line change
Expand Up @@ -30,7 +30,7 @@ Options:
--dev .............. Include devDependencies (defaults to production only).
--file=<File> ...... Sets package file. For more help run `snyk help file`.
--org=<org-name> ... Specify the org machine-name to run Snyk with a specific
organisation. For more help run `snyk help orgs`.
organization. For more help run `snyk help orgs`.
--ignore-policy .... Ignores the current policy in .snyk file, org level ignores and project policy on snyk.io.
--trust-policies ... Applies and uses ignore rules from your dependencies's
Snyk policies, otherwise ignore policies are only
Expand Down
6 changes: 3 additions & 3 deletions help/orgs.txt
Original file line number Diff line number Diff line change
@@ -1,5 +1,5 @@

Organisations:
Organizations:

To test or monitor your project for a specific org, you can add an optional
flag to the `test`, `monitor` and `wizard` commands:
Expand All @@ -10,10 +10,10 @@ flag to the `test`, `monitor` and `wizard` commands:
Notifications about newly disclosed vulnerabilities
related to these dependencies will be emailed to you.

If you have multiple organisations, you can set a default from the CLI using:
If you have multiple organizations, you can set a default from the CLI using:

$ snyk config set org=<my-default-org>

Setting a default will ensure all newly monitored projects will be created
under your default organisation. If you need to override the default, you can
under your default organization. If you need to override the default, you can
use the `--org=<other-org>` argument.
2 changes: 1 addition & 1 deletion src/cli/commands/protect/prompts.ts
Original file line number Diff line number Diff line change
Expand Up @@ -25,7 +25,7 @@ const moduleToObject = moduleToObjectJs as
const ignoreDisabledReasons = {
notAdmin: 'Set to ignore (only administrators can ignore issues)',
disregardFilesystemIgnores:
'Set to ignore (ignoring via the CLI is not enabled for this organisation)',
'Set to ignore (ignoring via the CLI is not enabled for this organization)',
};

// via http://stackoverflow.com/a/4760279/22617
Expand Down
Original file line number Diff line number Diff line change
Expand Up @@ -67,7 +67,7 @@ function constructPatchesText(
if (!(Object.keys(patches).length > 0)) {
return [];
}
const patchedTextArray = [chalk.bold.green('Patchable issues:')];
const patchedTextArray = [chalk.bold.green('\nPatchable issues:')];
for (const id of Object.keys(patches)) {
// todo: add vulnToPatch package name
const packageAtVersion = `${basicVulnInfo[id].name}@${basicVulnInfo[id].version}`;
Expand All @@ -91,7 +91,7 @@ function constructUpgradesText(
return [];
}

const upgradeTextArray = [chalk.bold.green('Upgradable Issues:')];
const upgradeTextArray = [chalk.bold.green('\nUpgradable Issues:')];
for (const upgrade of Object.keys(upgrades)) {
const upgradeDepTo = _.get(upgrades, [upgrade, 'upgradeTo']);
const vulnIds = _.get(upgrades, [upgrade, 'vulns']);
Expand All @@ -111,7 +111,7 @@ function constructUnfixableText(unresolved: IssueData[]) {
if (!(unresolved.length > 0)) {
return [];
}
const unfixableIssuesTextArray = [chalk.bold.white('Non-fixable issues:')];
const unfixableIssuesTextArray = [chalk.bold.white('\nIssues that cannot be fixed:')];
for (const issue of unresolved) {
const packageNameAtVersion = chalk.bold.whiteBright(`\n ${issue.packageName}@${issue.version} \n`);
unfixableIssuesTextArray
Expand Down
2 changes: 1 addition & 1 deletion src/cli/commands/test/index.ts
Original file line number Diff line number Diff line change
Expand Up @@ -383,7 +383,7 @@ function metaForDisplay(res, options) {
const packageManager = options.packageManager || res.packageManager;
const openSource = res.isPrivate ? 'no' : 'yes';
const meta = [
chalk.bold(rightPadWithSpaces('Organisation: ', padToLength)) + res.org,
chalk.bold(rightPadWithSpaces('Organization: ', padToLength)) + res.org,
chalk.bold(rightPadWithSpaces('Package manager: ', padToLength)) + packageManager,
];
if (options.file) {
Expand Down
26 changes: 13 additions & 13 deletions test/acceptance/cli.acceptance.test.ts
Original file line number Diff line number Diff line change
Expand Up @@ -241,8 +241,8 @@ test('`test ruby-app` meta when no vulns', async (t) => {
chdirWorkspaces();
const res = await cli.test('ruby-app');

const meta = res.slice(res.indexOf('Organisation:')).split('\n');
t.match(meta[0], /Organisation:\s+test-org/, 'organisation displayed');
const meta = res.slice(res.indexOf('Organization:')).split('\n');
t.match(meta[0], /Organization:\s+test-org/, 'organization displayed');
t.match(meta[1], /Package manager:\s+rubygems/,
'package manager displayed');
t.match(meta[2], /Target file:\s+Gemfile/, 'target file displayed');
Expand All @@ -268,8 +268,8 @@ test('`test ruby-app-thresholds`', async (t) => {
'Tested 7 dependencies for known vulnerabilities, found 6 vulnerabilities, 7 vulnerable paths',
'6 vulns');

const meta = res.slice(res.indexOf('Organisation:')).split('\n');
t.match(meta[0], /Organisation:\s+test-org/, 'organisation displayed');
const meta = res.slice(res.indexOf('Organization:')).split('\n');
t.match(meta[0], /Organization:\s+test-org/, 'organization displayed');
t.match(meta[1], /Package manager:\s+rubygems/,
'package manager displayed');
t.match(meta[2], /Target file:\s+Gemfile/, 'target file displayed');
Expand Down Expand Up @@ -549,8 +549,8 @@ test('`test gradle-kotlin-dsl-app` returns correct meta', async (t) => {
loadPlugin.withArgs('gradle').returns(plugin);

const res = await cli.test('gradle-kotlin-dsl-app');
const meta = res.slice(res.indexOf('Organisation:')).split('\n');
t.match(meta[0], /Organisation:\s+test-org/, 'organisation displayed');
const meta = res.slice(res.indexOf('Organization:')).split('\n');
t.match(meta[0], /Organization:\s+test-org/, 'organization displayed');
t.match(meta[1], /Package manager:\s+gradle/,
'package manager displayed');
t.match(meta[2], /Target file:\s+build.gradle.kts/, 'target file displayed');
Expand All @@ -573,10 +573,10 @@ test('`test gradle-app` returns correct meta', async (t) => {
loadPlugin.withArgs('gradle').returns(plugin);

const res = await cli.test('gradle-app');
const meta = res.slice(res.indexOf('Organisation:')).split('\n');
const meta = res.slice(res.indexOf('Organization:')).split('\n');

t.false(((spyPlugin.args[0] as any)[2] as any).multiDepRoots, '`multiDepRoots` option is not sent');
t.match(meta[0], /Organisation:\s+test-org/, 'organisation displayed');
t.match(meta[0], /Organization:\s+test-org/, 'organization displayed');
t.match(meta[1], /Package manager:\s+gradle/,
'package manager displayed');
t.match(meta[2], /Target file:\s+build.gradle/, 'target file displayed');
Expand Down Expand Up @@ -662,8 +662,8 @@ test('`test gradle-app --all-sub-projects` returns correct multi tree meta', asy
t.equals(tests.length, 2, 'two projects tested independently');
t.match(res, /Tested 2 projects/, 'number projects tested displayed properly');
for (let i = 0; i < tests.length; i++) {
const meta = tests[i].slice(tests[i].indexOf('Organisation:')).split('\n');
t.match(meta[0], /Organisation:\s+test-org/, 'organisation displayed');
const meta = tests[i].slice(tests[i].indexOf('Organization:')).split('\n');
t.match(meta[0], /Organization:\s+test-org/, 'organization displayed');
t.match(meta[1], /Package manager:\s+gradle/,
'package manager displayed');
t.match(meta[2], /Target file:\s+build.gradle/, 'target file displayed');
Expand All @@ -679,16 +679,16 @@ test('`test gradle-app --all-sub-projects` returns correct multi tree meta', asy
test('`test` returns correct meta when target file specified', async (t) => {
chdirWorkspaces();
const res = await cli.test('ruby-app', {file: 'Gemfile.lock'});
const meta = res.slice(res.indexOf('Organisation:')).split('\n');
const meta = res.slice(res.indexOf('Organization:')).split('\n');
t.match(meta[2], /Target file:\s+Gemfile.lock/, 'target file displayed');

});

test('`test npm-package-policy` returns correct meta', async (t) => {
chdirWorkspaces();
const res = await cli.test('npm-package-policy');
const meta = res.slice(res.indexOf('Organisation:')).split('\n');
t.match(meta[0], /Organisation:\s+test-org/, 'organisation displayed');
const meta = res.slice(res.indexOf('Organization:')).split('\n');
t.match(meta[0], /Organization:\s+test-org/, 'organization displayed');
t.match(meta[1], /Package manager:\s+npm/, 'package manager displayed');
t.match(meta[2], /Target file:\s+package.json/, 'target file displayed');
t.match(meta[3], /Open source:\s+no/, 'open source displayed');
Expand Down

0 comments on commit 9a95a78

Please sign in to comment.