Skip to content

Commit 34f6cdd

Browse files
author
Ashley Baldwin-Hunter
committed
Merge pull request #22 from codeclimate/abh-customize
customize strings
2 parents 41b7a09 + 2d9e61b commit 34f6cdd

File tree

2 files changed

+11
-6
lines changed

2 files changed

+11
-6
lines changed

Diff for: README.md

+4-3
Original file line numberDiff line numberDiff line change
@@ -26,9 +26,10 @@ You can specify what strings to match by adding a `strings` key in your
2626
engines:
2727
fixme:
2828
enabled: true
29-
strings:
30-
- FIXME
31-
- CUSTOM
29+
config:
30+
strings:
31+
- FIXME
32+
- CUSTOM
3233
```
3334
3435
**NOTE**: values specified here *override* the defaults, they are not

Diff for: lib/fix-me.js

+7-3
Original file line numberDiff line numberDiff line change
@@ -18,10 +18,14 @@ FixMe.prototype.runEngine = function(){
1818
self = this;
1919

2020
if (fs.existsSync('/config.json')) {
21-
var overrides = JSON.parse(fs.readFileSync('/config.json'));
21+
var userConfig = JSON.parse(fs.readFileSync('/config.json'));
2222

23-
for (var prop in overrides) {
24-
config[prop] = overrides[prop];
23+
config.include_paths = userConfig.include_paths;
24+
25+
if (userConfig.config) {
26+
for (var prop in userConfig.config) {
27+
config[prop] = userConfig.config[prop];
28+
}
2529
}
2630
}
2731

0 commit comments

Comments
 (0)