bazel-contrib / vscode-bazel

Bazel support for Visual Studio Code
https://marketplace.visualstudio.com/items?itemName=BazelBuild.vscode-bazel
Apache License 2.0
244 stars 79 forks source link

fix(coverage): Do not emit error on BRDA:0 entries #417

Closed cwahbong closed 3 weeks ago

cwahbong commented 4 weeks ago

Coverage report generators in Coverage.py would generate BRDA:0 for exit branches.

Ref: https://github.com/nedbat/coveragepy/blob/5467e1f/coverage/lcovreport.py#L108-L112

Also small string fixes for error messages in BRDA.

Improves #362.

cwahbong commented 4 weeks ago

I just saw other discussions about the misuse of the line number fields. Is it making sense for being tolerant the negative numbers or simply drop the invalid entries and maybe put a warning message somewhere, either pop up or on output window (I did not find the output window like in other plugin for this one) in case other coverage tools also misuse the line number field?

vogelsgesang commented 3 weeks ago

Is it making sense for being tolerant the negative numbers or simply drop the invalid entries and maybe put a warning message somewhere

Maybe. Let's keep it as is, and then potentially ignore also negative numbers in case we actually get reports of this being a real-world issue. (I prefer "fail early, fail hard" since this makes it much simpler to find potential issues/unexpected behavior).