Closed lylex closed 6 years ago
Ok, we forgot to ignore comments in the fix for #60 .
We can fix this easily by ignoring lines starting with "//" once trimmed.
However, ignoring multi-lines comments will be much harder until we have an analysis of the source file based on a real go grammar.
@thibaultfalque the fix for single line comments is trivial. For multi-lines, it may be possible to reuse the same trick used to ignore import statements, but based on the detection of the beginning and end of the multi-line comments.
Ok I see. I will fix this problem.
I have fix this issue.
The fix: d3889bf
The units tests: ee8c96fb4586509b4ce6b901ff8e6153494beb9d
The units test are apply on this file: issue61/simplelinecomment.go issue61/multilinecoment.go issue61/typestruct.go: 669e4e184f120f4451fe9650317b207880c2024a
@lylex could you test the last release ?
@thibaultfalque @danielleberre this release work well with my project, thanks for the quick response.
Description
When a package has no test file, it will computed the comment lines as executable.
Steps to Reproduce
Run the calculation, and push to sonar server using sonar-scanner
Go the sonar server web, and click "All Measures / Coverage Measures". Chose b.go file, and you you will find that some comments are calculated as executable lines.
Versions
Sonar Server: 6.5(build 27846) Sonar-golang Plugin: 1.2.11-rc11 GO: go1.9.2