-
Notifications
You must be signed in to change notification settings - Fork 140
Add SelectorName in UncheckedError #197
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
Conversation
@kisielk Could you please review this? One more attempt to integrate with golangci-lint |
Looks good to me. Would you mind also adding a test to the test suite? |
c3c70a7
to
89d00e3
Compare
sure, will add |
89d00e3
to
aeac866
Compare
@kisielk I added a very simple test, that the original line should contain the selectorName. Is it good enough? |
That is ok for now I think. The tests need a bit of a revamp to look for the specific test data anyway.. Let me check with the other maintainers if this change is ok then we can merge. |
Thanks |
There was a problem hiding this comment.
Choose a reason for hiding this comment
The reason will be displayed to describe this comment to others. Learn more.
Basically what Kamil already said, current check seems more like a smoke test, but doesn't look like we can do much more without involved refactoring. LGTM
we can write a test to test only the selectorName function, but I didn't;t figure out how to properly create the ast Tree to cover all cases. I will try to work on it |
@SVilgelm I wouldn't worry about it for now, I don't really want to test un-exported functions, we just need to go through and restructure the existing tests. |
@kisielk @dtcaciuc thank you! It works fine: golangci/golangci-lint#1319 |
I've tagged v1.6.0 |
Added a
SelectorName
field in theUncheckedError
struct to store the original func name.We cannot integrate the
errchecker
linter with thegolangci-lint
tool without this changes, we have an additional exclude ofos.Stdout|Stderr.Write
, but thefullName
function returns(*os.File).Write
and ignoringos.File
is not acceptable.