Add configuration file support and exclude option #213
Conversation
There was a problem hiding this comment.
Choose a reason for hiding this comment
The reason will be displayed to describe this comment to others. Learn more.
Looks like a good start. We need to fix CI and update the date in the copyright header for index.js
Trying to prompt Travis with a close/reopen |
Go Travis, go! |
There was a problem hiding this comment.
Choose a reason for hiding this comment
The reason will be displayed to describe this comment to others. Learn more.
Good progress, a few minor nits and some discussion comments where I make it obvious I'm not a JavaScript developer 😄
There was a problem hiding this comment.
Choose a reason for hiding this comment
The reason will be displayed to describe this comment to others. Learn more.
I'd like to see .precaution.yml
instead of .precaution.json
There was a problem hiding this comment.
Choose a reason for hiding this comment
The reason will be displayed to describe this comment to others. Learn more.
This PR looks good, thanks. I have a few minor nits about Git workflow but no need to block merge on those, consider them more as items to keep in mind in future.
* @return {Promise<any>} GitHub response | ||
* See https://developer.github.com/v3/repos/contents/#get-contents | ||
*/ | ||
async function getConfigFile (context) { | ||
async function getConfigFile (context, customConfigPath = config.configFilePath) { |
There was a problem hiding this comment.
Choose a reason for hiding this comment
The reason will be displayed to describe this comment to others. Learn more.
It's strange that we introduce a new function in commit one of this PR then immediately change it in commit two of the same PR. That's a perfectly natural way for code to evolve during development but not necessary to expose in the revision control history.
There was a problem hiding this comment.
Choose a reason for hiding this comment
The reason will be displayed to describe this comment to others. Learn more.
This is a change was introduced when we added our unit tests and that's why I change it in the commit where I added the unit tests.
@Browne want to take a last look at this PR before it merges? |
My mistake, apologies for the inconvenience @Browne |
Giving @ericwb a chance for another look before this merges. |
Our users need a way to configure Precaution for their needs. The first important option to enable will be the "exclude" option. That way the users can exclude their tests folders and files. We decided to give globs as a way for the users to be more flexible when they are creating exclude rules. Because YAML allows you to use comments and it's more human readable than JSON we decided to use .precaution.yaml as a config file. Closes: #179 Signed-off-by: Martin Vrachev <mvrachev@vmware.com>
When we support the configuration file feature we have to execute one more step in our workflow - checking if a Precaution configuration file exists and downloading it from the repository. Also, when we add new config options we should test them if we use them correctly in our workflow. Signed-off-by: Martin Vrachev <mvrachev@vmware.com>
There was a problem hiding this comment.
Choose a reason for hiding this comment
The reason will be displayed to describe this comment to others. Learn more.
LGTM
Our users need a way to configure Precaution for their needs.
The first important option to enable will be the "exclude" option.
That way the users can exclude their tests folders and files.
We decided to give globs as a way for the users to be more flexible
when they are creating exclude rules.
Because YAML allows you to use comments and it's more human readable
than JSON we decided to use .precaution.yaml as a config file.
Closes: #179
Signed-off-by: Martin Vrachev mvrachev@vmware.com