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

Invalid coloring in some specific cases #109

Open
bramborman opened this issue Mar 5, 2020 · 6 comments
Open

Invalid coloring in some specific cases #109

bramborman opened this issue Mar 5, 2020 · 6 comments
Labels

Comments

@bramborman
Copy link

I'm getting some wrongly-colored lines in my output on lines such as this:

15>Foo.cs(226,17,226,89): warning CA1806: Bar calls TryParse but does not explicitly check whether the conversion succeeded....

It's a warning message but probably because it contains the string succeeded it gets colored to the green success-color instead of warning yellow color.

I think warning should have precedence over success maybe every time or it should be checked by what appears earlier in the string?

@mike-ward
Copy link
Owner

Probably need a separate rule that checks for a specific warning pattern. Something that matches warning ??number: perhaps.

@mike-ward mike-ward added the bug label Mar 5, 2020
@bramborman
Copy link
Author

Well it works perfectly for other lines with the same pattern that do not contain the word succeeded so I guess the problem is that the string contains both warning and succeeded and the success color takes precedence. IMHO it should be that warnings have precedence.

Here is probably more obvious example:

repro

@mike-ward
Copy link
Owner

You do know you can edit the regex's for pattern matching, right? Maybe you could try altering the regex's to get the desired result (IMHO)...

@bramborman
Copy link
Author

Yeah, I know and I can confirm that just by reordering the original patterns this issue can be fixed. I reported it because I think it should be so by default so people like me who filter the output by color when quickly looking at it are not misled. But that's just my opinion...

@mike-ward
Copy link
Owner

Agreed. Just needed to know if that fixed your issue. So I assume just bumping it up one level fixed it. I'll add this to a new release soon.

@bramborman
Copy link
Author

Actually had to do something more as the warning regex that needed to be moved up was the maybe second or third lowest. I don't really remember and there's no Reset to default button but maybe all the warning regexes should be higher than the success ones?

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

No branches or pull requests

2 participants