Skip to content
New issue

Have a question about this project? Sign up for a free GitHub account to open an issue and contact its maintainers and the community.

By clicking “Sign up for GitHub”, you agree to our terms of service and privacy statement. We’ll occasionally send you account related emails.

Already on GitHub? Sign in to your account

WIP: Add --output-format oneline options for easier editor integration #84

Closed
wants to merge 2 commits into from

Conversation

eToThePiIPower
Copy link

Editor integration for linters tend to work better with one line per
offense, unlike the more human-oriented default of two line + newline
per offense. In particular I'm thinking of the regexes used bye ALE for vim.

This adds an --output-format oneline command-line option for a more
compact and machine-parsable output format. Omitting the option ore using --output-format multipline uses the current "two lines + newline" output. The oneline output takes the form
of:

<filename>:<start-line>:<start-col>:<offense-message>

I'm marking this as a WIP because I'd like feedback as to my approach, and whether this is a feature the maintainers would be interested in. I'm also investigating a JSON output option, which should be a relatively straightforward extension of this approach once a schema is decided on. The schema used by Rubocop's JSON formatter might be a good starting point.

Editor integrations for linters tend to work better with one line per
offense, unlike the more human-oriented default of two line + newline
per offense.

This adds an `--output-format oneline` command-line option for a more
compact and machine-parseable output format. The output takes the form
of:

```
<filename>:<start-line>:<start-col>:<offense-message>
```
@EiNSTeiN-
Copy link

This looks good. If more output formats are added we would likely have to extract the code in individual formatter objects. Anything else you would like to add before removing WIP?

@mgoggin
Copy link

mgoggin commented Oct 9, 2018

Has there been any movement on this?

We've started using erb_lint on projects, and I want to see this linter's violations show up in my editor.

I'm thinking of contributing a JSON formatter, but do not want to reimplement the wheel on an interface if this one is ready to roll.

What can I do to help to get formatting support implemented as part of an official release of erb_lint?

@manuelpuyol manuelpuyol mentioned this pull request Jul 2, 2021
Sign up for free to join this conversation on GitHub. Already have an account? Sign in to comment
Labels
None yet
Projects
None yet
Development

Successfully merging this pull request may close these issues.

5 participants