diff --git a/RuboCop.novaextension/CHANGELOG.md b/RuboCop.novaextension/CHANGELOG.md index c8bd4a9..c01dae8 100644 --- a/RuboCop.novaextension/CHANGELOG.md +++ b/RuboCop.novaextension/CHANGELOG.md @@ -1,4 +1,7 @@ -# ChangeLog +## UNRELEASED + +- Configured RuboCop to omit cop names from returned messages (the names were + previously being stripped manually during parsing). ## Version 0.2.1 diff --git a/Source/Scripts/Offense.js b/Source/Scripts/Offense.js index 405deca..c528e9d 100644 --- a/Source/Scripts/Offense.js +++ b/Source/Scripts/Offense.js @@ -22,9 +22,7 @@ class Offense { issue.source = "RuboCop"; issue.code = this.cop; - - const cleanedMessage = this.message.replace(`${this.cop}: `, ""); - issue.message = cleanedMessage; + issue.message = this.message; if (this.severity == "warning") { issue.severity = IssueSeverity.Warning; diff --git a/Source/Scripts/RuboCopProcess.js b/Source/Scripts/RuboCopProcess.js index 233731b..eaf74da 100644 --- a/Source/Scripts/RuboCopProcess.js +++ b/Source/Scripts/RuboCopProcess.js @@ -13,13 +13,17 @@ class RuboCopProcess { constructor(path, content) { this.path = path; this.content = content; + this.defaultArguments = [ + "--format=json", + "--no-display-cop-names" + ]; } get process() { if (this._process) return this._process; const process = new Process("/usr/bin/env", { - args: ["rubocop", "--format=json", "--stdin", this.path], + args: ["rubocop", this.defaultArguments, "--stdin", this.path].flat(), cwd: nova.workspace.path, stdio: "pipe" });