-
Notifications
You must be signed in to change notification settings - Fork 122
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
Editor integration #225
Comments
vim is now supported: dense-analysis/ale#3931 |
Maybe we should document in the README? Mind to open a PR? |
I'm attempting to integrate Is there way to silence the "report" without parsing the output manually? By "report" I mean, for example, the following:
The file gets correctly auto-fixed, but the report is appended to the top of the file. |
Came here to comment the same thing as @vlasar. I would like to to using this in nvim conform with stdin mode so that it's fast but the report output injected at the top messes that up. Maybe it could have a |
@vlasar @nickpoorman I'm a bit late, so I hope you already found solution, but if not, you should be able to use conform with formatters = {
erb_lint = {
stdin = false,
tmpfile_format = ".conform.$RANDOM.$FILENAME",
command = "bundle",
args = { "exec", "erblint", "--autocorrect", "$FILENAME" },
},
}, Hope it helps! |
@rrothenberger Awesome. That works great. Thank you! |
Summary
erb-lint
is a great tool to keep your ERB consistent and avoid known security issues, such as rendering raw inputs.However, the linting process is usually late in the development process, typically being run during CI, which can slow down developers since they may only get notified of errors after opening a PR and getting the build to fail.
Proposal
Make
erb-lint
easy to integrate with editors (Vim, Emacs, VSCode...) so developers can have real-time feedback of the ERB they are editing.Problems
The current output that
erb-lint
provides does not contain all the necessary information to decorate editors with the exact location of linting errors. Right now, it's only possible to get the line where the error occurs instead of the whole block (line + columns).Solution
Adding a generic formatter that exposes more data about the error, such as a JSON formatter, similar to rubocop's formatter.
Exposing structured information about the errors in the file would allow better decorations for editors, like underlining the exact location of offenses.
Related
#173
#219
#224
The text was updated successfully, but these errors were encountered: