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

Support additional lint levels beyond warning and error #149

Closed
euclio opened this issue Oct 25, 2016 · 10 comments
Closed

Support additional lint levels beyond warning and error #149

euclio opened this issue Oct 25, 2016 · 10 comments

Comments

@euclio
Copy link

euclio commented Oct 25, 2016

Some linters emit low-severity messages or additional information that is not considered a warning or an error. It would be useful to be able to represent these within ALE. For example, Neomake has 4 levels (error, warning, message, info).

@w0rp
Copy link
Member

w0rp commented Oct 25, 2016

We'll have to look into this. I started initially only supporting the two flags that loclist supports, 'E' and 'W'`. We can add arbitrary keys into the loclist items, so maybe we could store more information on the objects for use in the statusline, etc.

@blueyed
Copy link
Contributor

blueyed commented Dec 15, 2016

Does the loclist really support only "E" and "W"?

Related: neomake/neomake#584

@w0rp
Copy link
Member

w0rp commented Dec 15, 2016

I just had a look at :help setqflist(), which is where :help setloclist() sends you. It says only this.

type    single-character error type, 'E', 'W', etc.

I guess by "etc." you can set other error types as long as you use a single character.

@blueyed
Copy link
Contributor

blueyed commented Dec 15, 2016

Yep.

@euclio
Copy link
Author

euclio commented Jan 30, 2017

I'd like to try implementing this. Should I just add support for info and message levels?

@w0rp
Copy link
Member

w0rp commented Jan 30, 2017

Yeah, go for it. Some work will need to be done for each linter, where the different error levels are available, and some work will be needed for signs, the statusline, etc.

@w0rp w0rp mentioned this issue Feb 8, 2017
@w0rp w0rp added this to the Version 1.4 milestone May 7, 2017
@w0rp
Copy link
Member

w0rp commented May 20, 2017

Type 'I' for "info", and style errors and warnings through sub_type 'style' are now supported for signs, but nothing else yet. Everything else still needs to be adjusted.

@w0rp
Copy link
Member

w0rp commented May 21, 2017

I just pushed a commit so the status lines will continue to work if the other problem types are set. Now ale#statusline#Count() returns a Dictionary containing the keys total, error, warning, info, style_error, and style_warning, mapping to the counts for each. Two extra keys 0 and 1 are set so the Dictionary will continue to function with the airline extension here: https://github.com/vim-airline/vim-airline/blob/06351e86df61b79bd00971d6c2f33c286a048b22/autoload/airline/extensions/ale.vim#L11 The sum of error and style_error are set for 0, and the sum of warning, style_warning, and info are set for 1.

So the status functions should now tolerate the new problem types, and produce the current output.

w0rp added a commit that referenced this issue May 21, 2017
@w0rp
Copy link
Member

w0rp commented May 21, 2017

I pushed a commit for setting different syntax highlights for "info" items, style warnings, and style errors. Info and style warnings map to the highlights for warnings for now, and style errors map to the error highlights.

@w0rp
Copy link
Member

w0rp commented May 21, 2017

Other types should be supported everywhere now. Individual linters will need to be updated to do something meaningful. Some better defaults can be set for highlights, etc., later. The new highlight groups have been documented.

I'll think about a new statusline format, which will also fix #323.

Sign up for free to join this conversation on GitHub. Already have an account? Sign in to comment
Projects
None yet
Development

No branches or pull requests

3 participants