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
inlined nosec comments fails linting #9
Comments
nick-jones
pushed a commit
to utilitywarehouse/impi
that referenced
this issue
May 11, 2020
This should be more reliable than stripping out unwanted parts of the import line. Most notably it resolves pavius#9 Note that I've not been able to verify this on an exhaustive set of examples. Also note that there are still potential gotchas around mutli line comments.. debatable whether or not those are worth addressing (and definitely not wanting to cover in this PR, given it has immediate benefits).
pavius
pushed a commit
that referenced
this issue
May 23, 2020
* Use go/scanner to extract import path This should be more reliable than stripping out unwanted parts of the import line. Most notably it resolves #9 Note that I've not been able to verify this on an exhaustive set of examples. Also note that there are still potential gotchas around mutli line comments.. debatable whether or not those are worth addressing (and definitely not wanting to cover in this PR, given it has immediate benefits). * Improve error line; ensure a string is printed
Appreciate the fix @nick-jones 👍 |
Sign up for free
to join this conversation on GitHub.
Already have an account?
Sign in to comment
This example, should pass (I hope):
test.go
but it fails:
$ impi --scheme stdThirdPartyLocal test.go
We need to inline the
// #nosec
on import statements (for gosec -- "safe" usage of md5/sha1 in out codebase). This utility is conflicting with gofumpt and gosec -- can't make all three happy simultaneously :)I believe this utility should allow inline comments on import statements. From the Got/Expected output, it seems this linter is eating the imported package name and trying to sort based on the inline'd comment...
The text was updated successfully, but these errors were encountered: