Skip to content
This repository has been archived by the owner on Aug 7, 2023. It is now read-only.

Fix error whitelist #237

Merged
merged 1 commit into from
Jan 8, 2018
Merged
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
1 change: 1 addition & 0 deletions lib/main.js
Original file line number Diff line number Diff line change
Expand Up @@ -18,6 +18,7 @@ const os = lazyReq('os');
// Some local variables
const errorWhitelist = [
/^No config file found, using default configuration$/,
/^Using config file .+$/,
Copy link
Contributor

Choose a reason for hiding this comment

The reason will be displayed to describe this comment to others. Learn more.

This would be simpler and just as correct:
/^Using config file /,

Copy link
Member

Choose a reason for hiding this comment

The reason will be displayed to describe this comment to others. Learn more.

You're technically right that since this list of RegEx is tested against every line of stderr either version would work (and yours is slightly better for performance). The merged version works when testing against the entire stderr if the code is refactored later to do that, and matches the behavior of the existing RegEx though.

Copy link
Contributor

Choose a reason for hiding this comment

The reason will be displayed to describe this comment to others. Learn more.

I committed the simplification directly on master before your reply.

Speculative benefit in case we start matching the entire stderr does not seem worthwhile.

The behaviour of the existing regex is correct because we do match the entire line, but the new regex only matches the start of the line.

So I favored the simpler code. I'll revert my change if you care.

];

const getProjectDir = (filePath) => {
Expand Down