Skip to content

Commit 445aa11

Browse files
author
ABaldwinHunter
committed
Make fixme strings customizable
1 parent 41b7a09 commit 445aa11

File tree

3 files changed

+15
-8
lines changed

3 files changed

+15
-8
lines changed

.codeclimate.yml

Lines changed: 7 additions & 1 deletion
Original file line numberDiff line numberDiff line change
@@ -1,6 +1,11 @@
11
engines:
22
fixme:
3-
enabled: false
3+
enabled: true
4+
config:
5+
strings:
6+
- todo
7+
- WIP
8+
- legacy
49
eslint:
510
enabled: true
611
ratings:
@@ -11,3 +16,4 @@ exclude_paths:
1116
- "Dockerfile"
1217
- "bin/fixme"
1318
- "tests/**"
19+
- ".codeclimate.yml"

README.md

Lines changed: 4 additions & 3 deletions
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

lib/fix-me.js

Lines changed: 4 additions & 4 deletions
Original file line numberDiff line numberDiff line change
@@ -18,10 +18,10 @@ FixMe.prototype.runEngine = function(){
1818
self = this;
1919

2020
if (fs.existsSync('/config.json')) {
21-
var overrides = JSON.parse(fs.readFileSync('/config.json'));
22-
23-
for (var prop in overrides) {
24-
config[prop] = overrides[prop];
21+
var user_config = JSON.parse(fs.readFileSync('/config.json'));
22+
config.include_paths = user_config['include_paths'];
23+
if (user_config.config && user_config['config']['strings']) {
24+
config.strings = user_config['config']['strings']
2525
}
2626
}
2727

0 commit comments

Comments
 (0)