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

Fix #736 #738

Merged
merged 1 commit into from Dec 13, 2021
Merged

Fix #736 #738

merged 1 commit into from Dec 13, 2021

Conversation

Yiwei-Ding
Copy link
Contributor

@Yiwei-Ding Yiwei-Ding commented Dec 13, 2021

This PR is to fix #736.

Root cause

Block comments will have an extra whitespace before the comment content that gotten from group.Text(). In the following table, indicates to a whitespace.

comment group.Text()
// #nosec /* #nosec */
#nosec ▯#nosec

In PR #735, #nosec or other noSecAlternativeTag is treated as a prefix of the annotation. There was not a test case that covered block comments and resulted in #736.

Solution in this PR

Remove the whitespaces before comments with strings.Trim().

@codecov-commenter
Copy link

Codecov Report

Merging #738 (71fa103) into master (b45f95f) will not change coverage.
The diff coverage is 100.00%.

Impacted file tree graph

@@           Coverage Diff           @@
##           master     #738   +/-   ##
=======================================
  Coverage   73.91%   73.91%           
=======================================
  Files          47       47           
  Lines        2891     2891           
=======================================
  Hits         2137     2137           
  Misses        692      692           
  Partials       62       62           
Impacted Files Coverage Δ
analyzer.go 90.67% <100.00%> (ø)

Continue to review full report at Codecov.

Legend - Click here to learn more
Δ = absolute <relative> (impact), ø = not affected, ? = missing data
Powered by Codecov. Last update b45f95f...71fa103. Read the comment docs.

Copy link
Member

@ccojocar ccojocar left a comment

Choose a reason for hiding this comment

The reason will be displayed to describe this comment to others. Learn more.

Thanks for fixing so quick the issue!

@ccojocar ccojocar merged commit 35af340 into securego:master Dec 13, 2021
@Yiwei-Ding Yiwei-Ding deleted the FixInlineSuppressionIssue branch December 17, 2021 16:37
Sign up for free to join this conversation on GitHub. Already have an account? Sign in to comment
Labels
None yet
Projects
None yet
Development

Successfully merging this pull request may close these issues.

Some of the inline code annotation stopped working
3 participants