Closed andyw8 closed 6 months ago
As soon as I opened this, I spotted that @Earlopain already has a similar PR: https://github.com/Shopify/erb-lint/pull/328
The main differences are:
Your implementation is better, I've closed my PR. I do think it should be enabled by default though, same as RuboCop does it.
They print cop names if there is more than one cop enabled, so if you run with --only Lint/Abc
the cop name will be omitted since it is unambiguous. Seems to be --enable-linters
here, however I don't know how that interacts with the rubocop cops.
Thanks @Earlopain
My only concern about enabling it by default is that someone may have built tooling based on the current report format (although the JSON reporter would have been a better choice).
I'll wait for others to weigh in on whether to make this the default behaviour.
Note: If allowing this to be set, we should probably also add a ShowLinterNames
option for the config file.
Rebased to resolve conflicts.
Closes #336
This PR adds a
--show-linter-names
option. It prepends each offence with the linter name.It applies only to the Multiline and Compact reporters. The JSON and JUnit reporters already include the linter name, so I have left them as-is.
Note: If RuboCop is enabled, RuboCop offences will display as:
(the cop name part was already there, but having the
[RuboCop]
prefix now makes it easier to distinguish the source of each offence).