Skip to content

Commit

Permalink
feat: support yaml config
Browse files Browse the repository at this point in the history
  • Loading branch information
Eugene Jo authored and gjvis committed Oct 11, 2016
1 parent 81db53d commit 596960c
Show file tree
Hide file tree
Showing 2 changed files with 7 additions and 2 deletions.
6 changes: 5 additions & 1 deletion lib/index.js
Original file line number Diff line number Diff line change
@@ -1,5 +1,7 @@
require('clarify'); // clean the stacktraces
const path = require('path');
const yaml = require('js-yaml');
const fs = require('fs');

const app = module.exports = {
client: require('./client'),
Expand Down Expand Up @@ -32,7 +34,9 @@ function main({ port, client } = {}) {
let filters = {};
if (config.accept) {
debug('loading rules from %s', config.accept);
filters = require(path.resolve(process.cwd(), config.accept));
const acceptLocation = path.resolve(process.cwd(), config.accept);

filters = yaml.safeLoad(fs.readFileSync(acceptLocation, 'utf8'));
}


Expand Down
3 changes: 2 additions & 1 deletion package.json
Original file line number Diff line number Diff line change
Expand Up @@ -57,7 +57,8 @@
"snyk-config": "^1.0.1",
"then-fs": "^2.0.0",
"undefsafe": "^1.2.0",
"snyk": "^1.19.1"
"snyk": "^1.19.1",
"js-yaml": "^3.6.1"
},
"repository": {
"type": "git",
Expand Down

0 comments on commit 596960c

Please sign in to comment.