Skip to content

Commit

Permalink
Improve bot error messages (remoteintech#637)
Browse files Browse the repository at this point in the history
  • Loading branch information
nylen authored Oct 14, 2019
1 parent 045e6db commit f3969f2
Show file tree
Hide file tree
Showing 2 changed files with 10 additions and 10 deletions.
6 changes: 3 additions & 3 deletions lib/index.js
Original file line number Diff line number Diff line change
Expand Up @@ -195,7 +195,7 @@ exports.parseFromDirectory = contentPath => {
readmeEntry.linkedFilename = match[ 1 ];
if ( profileFilenames.indexOf( readmeEntry.linkedFilename ) === -1 ) {
readmeError(
'Broken link to company "%s": "%s"',
'Missing company profile for "%s", or broken link: "%s"',
readmeEntry.name,
$profileLink.attr( 'href' )
);
Expand All @@ -211,14 +211,14 @@ exports.parseFromDirectory = contentPath => {
}
} else {
readmeError(
'Invalid link to company "%s": "%s"',
'Invalid link to company profile for "%s": "%s"',
readmeEntry.name,
$profileLink.attr( 'href' )
);
}
} else {
readmeError(
'Company "%s" has no linked Markdown profile ("%s.md")',
'Company "%s" has no linked Markdown profile ("/company-profiles/%s.md")',
readmeEntry.name,
companyNameToProfileFilename( readmeEntry.name )
);
Expand Down
14 changes: 7 additions & 7 deletions test/validation-errors.js
Original file line number Diff line number Diff line change
Expand Up @@ -24,14 +24,14 @@ describe( 'validation errors', () => {
expectValidateFixturesResult( 'missing-company-names', {
errorCount: 11,
output: [
'README.md: Company "⚠⚠⚠" has no linked Markdown profile (".md")',
'README.md: Company "⚠⚠⚠" has no linked Markdown profile ("/company-profiles/.md")',
'README.md: Missing company name: <td></td><td><a href="https://andyet.com">https://andyet.com</a></td><td>Worldwide</td>',
'README.md: Company is listed out of order: "" (should be before "⚠⚠⚠")',
'README.md: Company "" has no linked Markdown profile (".md")',
'README.md: Company "" has no linked Markdown profile ("/company-profiles/.md")',
'README.md: Missing company name: <td><a href="/company-profiles/10up.md"></a> &#x26A0;</td><td><a href="https://10up.com/">https://10up.com/</a></td><td>Worldwide</td>',
'README.md: Missing company name: <td><a href="/company-profiles/17hats.md"></a></td><td><a href="https://www.17hats.com/">https://www.17hats.com/</a></td><td>Worldwide</td>',
'README.md: Missing company name: <td></td><td><a href="https://18f.gsa.gov/">https://18f.gsa.gov/</a></td><td>USA</td>',
'README.md: Company "" has no linked Markdown profile (".md")',
'README.md: Company "" has no linked Markdown profile ("/company-profiles/.md")',
'10up.md: Profile looks complete, but the main readme contains a warning emoji.',
'18f.md: No link to company profile from readme',
'and-yet.md: No link to company profile from readme',
Expand All @@ -53,10 +53,10 @@ describe( 'validation errors', () => {
expectValidateFixturesResult( 'bad-profile-links', {
errorCount: 4,
output: [
'README.md: Invalid link to company "&yet": "company-profiles/and-yet.md"',
'README.md: Broken link to company "17hats": "/company-profiles/17hats-nonexistent.md"',
'README.md: Invalid link to company "18F": "/company-profiles/18f.js"',
'README.md: Company "My awesome company" has no linked Markdown profile ("my-awesome-company.md")',
'README.md: Invalid link to company profile for "&yet": "company-profiles/and-yet.md"',
'README.md: Missing company profile for "17hats", or broken link: "/company-profiles/17hats-nonexistent.md"',
'README.md: Invalid link to company profile for "18F": "/company-profiles/18f.js"',
'README.md: Company "My awesome company" has no linked Markdown profile ("/company-profiles/my-awesome-company.md")',
],
} );
} );
Expand Down

0 comments on commit f3969f2

Please sign in to comment.