Skip to content
This repository was archived by the owner on Jul 31, 2023. It is now read-only.
Merged
Show file tree
Hide file tree
Changes from all commits
Commits
File filter

Filter by extension

Filter by extension

Conversations
Failed to load comments.
Loading
Jump to
Jump to file
Failed to load files.
Loading
Diff view
Diff view
1 change: 1 addition & 0 deletions readme.md
Original file line number Diff line number Diff line change
Expand Up @@ -130,6 +130,7 @@ Settings available (in your VSCode workspace) for each of the linters:
"lint": true, //enable all lint cops.
"only": [/* array: Run only the specified cop(s) and/or cops in the specified departments. */],
"except": [/* array: Run all cops enabled by configuration except the specified cop(s) and/or departments. */],
"forceExclusion": true, //Add --force-exclusion option
"require": [/* array: Require Ruby files. */],
"rails": true //Run extra rails cops
}
Expand Down
4 changes: 4 additions & 0 deletions src/lint/lib/linters/RuboCop.js
Original file line number Diff line number Diff line change
Expand Up @@ -8,6 +8,7 @@ function RuboCop(opts) {

this.args = ["-s", "{path}", "-f", "json"] ;

if (opts.forceExclusion) this.args.push("--force-exclusion");
if (opts.lint) this.args.push("-l");
if (opts.only) this.args = this.args.concat("--only", opts.only.join(','));
if (opts.except) this.args = this.args.concat("--except", opts.except.join(','));
Expand All @@ -20,6 +21,9 @@ RuboCop.prototype.processResult = function (data) {
return [];
}
let offenses = JSON.parse(data);
if (offenses.summary.offense_count == 0) {
return [];
}
return (offenses.files || [{
offenses: []
}])[0].offenses;
Expand Down