oelint: Fix parsing of color enabled output#931
Conversation
If color is enabled through oelint configuration the parser wont match and no issues are reported. Stripping the ANSI color sequences from the linter output addresses this.
mfussenegger
left a comment
There was a problem hiding this comment.
Would it be possible to instead override the config with some kind of argument/flag, or setting a NO_COLOR env variable?
|
Unfortunately not. The CLI allows enable only and there are no env variables for config override. |
|
Any chance to bring this up upstream to have an option to force no-colors? I'd like to avoid having to deal with this in nvim-lint. Other editor integrations likely have the same problem. See also http://no-color.org/ |
This reverts commit e2f9081.
If color is enabled through oelint configuration the parser wont match and no issues are reported.
|
While this works as expected when calling the parser manually, nvim-lint doesn't show any warnings. The UpdateNot touching anything at all, but just using master works now!? 🤔 |
That's currently sort of working as intended. It only preserves
That's odd, can you investigate more? |
I need to look into that more carefully; that's at least how it seems.
Error on my end, configuration file wasn't picked up correctly. |
| }, | ||
| env = { | ||
| ["NO_COLOR"] = "1", | ||
| ["HOME"] = os.getenv("HOME"), |
There was a problem hiding this comment.
The missing HOME caused the linter to crash because it relies on it. A naive fix is to restore it that way. Is there a better solution?
There was a problem hiding this comment.
I'm considering to copy the current env by default if any linter.env variables are set. But for now this seems like a good solution
If color is enabled through oelint configuration the parser wont match and no issues are reported.
Stripping the ANSI color sequences from the linter output addresses this.