-
Notifications
You must be signed in to change notification settings - Fork 1.4k
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
Fix a format for echoed string #48
Comments
Yeah, sounds good. I think there should be some options for enabling/disabling the linter name and the severity. I suppose there would only be two severity values at the moment, "Error" and "Warning." I'd set the linter names and the Severity to be off by default, and explain the new flags in the README and the new help file. |
These kinds of messages will be especially helpful once quickfix support is in. |
Most of the time, only 'Error' and 'Warning' are reported by linters (Sometimes 'Style') so yes, those two are enough. |
I've already started to work on this, and the severity + type are already done (Disabled by default and configurable). But for the linter, I still don't know where can I get the name of the current used one. Any idea? |
You'll have to associate each warning/error with each linter, as more than one linter could be run for the same buffer. I'd try adding a key to each of the loclists returned by the Handle functions which maps to the linter name the warnings and errors are for, and see if that breaks setting the loclist at all. If it doesn't, then you should be able to read that key in the echo functions to get the linter names. I'm thinking of something like this in for item in linter_loclist
item.linter_name = linter.name
endfor |
Try that. Make a branch where we'll work. |
Check out the |
Great thanks. I'll come with something tomorrow. |
Via `g:ale_echo_msg_format` where: - `%s` is the error message itself - `%linter%` is the linter name - `%severity` is the severity type e.g let g:ale_echo_msg_fomat = '[%linter%] [%severity%] %s'
Via `g:ale_echo_msg_format` where: - `%s` is the error message itself - `%linter%` is the linter name - `%severity` is the severity type e.g let g:ale_echo_msg_fomat = '[%linter%] [%severity%] %s'
* Implement an option to configure the echoed message, #48 Via `g:ale_echo_msg_format` where: - `%s` is the error message itself - `%linter%` is the linter name - `%severity` is the severity type e.g let g:ale_echo_msg_fomat = '[%linter%] [%severity%] %s' * Add new options for defining the string used for errors in echoed message `g:ale_echo_msg_error_str` and `g:ale_echo_msg_warning_str` * Change text output of some linters Now that the echoed message can be customized, no need to add the type to the text variable. * Update README & documentation file * Fix some typos * Sort the table of options alphabetically (except echo_msg_x_str options) * Added echo warning str option to the doc
Now each linter use its own format for the echoed message, so it will be great to decide and specify only one format to use.
IMHO something like that will be good:
When we know the severity
And when we don't know:
Note that the 1st letter of
severity
/text
is in capital.I'm thinking that
linter-name
can be helpful for the file types using multiple ones.@w0rp If you agree, I can make a PR.
The text was updated successfully, but these errors were encountered: