SublimeLinter / SublimeLinter-rubocop

SublimeLinter 3 plugin for Ruby, using rubocop.
MIT License
159 stars 40 forks source link

Feature request: Display cop name in linter errors #44

Closed xob closed 6 years ago

xob commented 6 years ago

In cases where a developer would want to disable a cop in order to avoid linter errors, it would be useful to display the cop name responsible for the error to quickly find the one to disable.

For example, if I have the Style/ClassVars cop active, I might get this error message: Replace class var @@language with a class instance var.

I think it would be nice to have this message instead: Replace class var @@language with a class instance var. (Style/ClassVars)

I know the json format outputs the cop name, but that would mean quite a radical change of approach to the linter, having to parse JSON to display linter errors. There may be other formats giving that information, but I do not know which ones they would be.

xob commented 6 years ago

Well, nevermind, I'm an idiot. I just took some time to really look at things, and rubocop has a parameter called --display-cop-names, which displays cop names in error messages.

With that argument, the message comes out as Style/ClassVars: Replace class var @@language with a class instance var.

So technically SublimeLinter-rubocop already supports this by adding an arg in SublimeLinter settings.