-
Notifications
You must be signed in to change notification settings - Fork 15
Ignore extensions #37
Changes from 4 commits
ebd7dda
ba1574b
1a83cd0
35e0270
08fa0d1
9840b5d
c753753
68543ef
97dd826
c36c2e8
File filter
Filter by extension
Conversations
Jump to
Diff view
Diff view
There are no files selected for viewing
Original file line number | Diff line number | Diff line change |
---|---|---|
|
@@ -5,6 +5,10 @@ export default { | |
rubyExecutablePath: { | ||
type: "string", | ||
default: "ruby" | ||
}, | ||
ignoredExtensions: { | ||
type: "string", | ||
default: "erb,md" | ||
} | ||
}, | ||
|
||
|
@@ -38,7 +42,18 @@ export default { | |
lintOnFly: true, | ||
lint: (activeEditor) => { | ||
const command = atom.config.get("linter-ruby.rubyExecutablePath"); | ||
const ignored = atom.config.get("linter-ruby.ignoredExtensions"); | ||
const filePath = activeEditor.getPath(); | ||
var ignore = false; | ||
There was a problem hiding this comment. Choose a reason for hiding this commentThe reason will be displayed to describe this comment to others. Learn more.
|
||
|
||
ignored.split(",").forEach(function (extension) { | ||
There was a problem hiding this comment. Choose a reason for hiding this commentThe reason will be displayed to describe this comment to others. Learn more. You won't have to split if you make it an array. Also you should do for...of instead of foreach, You won't have to use the There was a problem hiding this comment. Choose a reason for hiding this commentThe reason will be displayed to describe this comment to others. Learn more. Awesome, thanks again 👍 |
||
if (filePath.split(".").pop() === extension.trim()) { | ||
ignore = true; | ||
}; | ||
}); | ||
|
||
if (ignore) return []; | ||
|
||
return helpers.exec(command, ['-wc'], {stdin: activeEditor.getText(), stream: 'stderr'}).then(output => { | ||
var toReturn = []; | ||
output.split(/\r?\n/).forEach(function (line) { | ||
|
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.