microsoft / component-detection

Scans your project to determine what components you use
MIT License
398 stars 83 forks source link

Handle comments gracefully by the go fallback detector. #1027

Closed jcfiorenzano closed 4 months ago

jcfiorenzano commented 4 months ago

This PR fixes issue #645. The parser of go.mod files was recognizing comments as components. The main change in this PR is to skip the lines that are comments before passing it out to the line parser.

go.mod files do not support multiline comments. Every commented line should start with (//). go.sum files do not support comments as there are auto-generated files.

Ex: image

image

codecov[bot] commented 4 months ago

Codecov Report

All modified and coverable lines are covered by tests :white_check_mark:

Project coverage is 75.4%. Comparing base (5be8728) to head (942a49e).

Additional details and impacted files ```diff @@ Coverage Diff @@ ## main #1027 +/- ## ===================================== Coverage 75.4% 75.4% ===================================== Files 236 236 Lines 10408 10411 +3 Branches 1039 1040 +1 ===================================== + Hits 7851 7854 +3 Misses 2267 2267 Partials 290 290 ```

:umbrella: View full report in Codecov by Sentry.
:loudspeaker: Have feedback on the report? Share it here.

github-actions[bot] commented 4 months ago

👋 Hi! It looks like you modified some files in the Detectors folder. You may need to bump the detector versions if any of the following scenarios apply:

If none of the above scenarios apply, feel free to ignore this comment 🙂