-
Notifications
You must be signed in to change notification settings - Fork 41
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
Enforce cuddling err checks #66
Enforce cuddling err checks #66
Conversation
Pull Request Test Coverage Report for Build 163
💛 - Coveralls |
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.
Thank you so much for this, really appreciated!
I added some comments in my review but the most important one is if we should leave the logic where this only applies to nil-checks. Like my review states I think not. If you remove that limitation it will be far less code too, e.g. no need for isCheckingErrAgainstNil
. Let me know what you think!
Again, thanks! 🚀
Nice work, thanks! I agree that AST can be a love-hate thing. But I hope my way of working with it doesn't make your first experience bad. 😃 You really have to appreciate the ast and token package from Go standard library though, very powerfull! The next step for this package will be to work with fixers using the analysis package. I also need to find a better way to group comments and keep track of more than two statements at the same time. |
Thanks so much for the quick review!! :D I've addressed the feedback and it really did cut down on the amount of code!! I thought I'd tried some of these suggestions before and they broke other tests, but in my continual refactoring and fixing I must have corrected whatever issue resulted in that. Since I broke the assumption that "If we made it to the case statement we're not cuddled" I had to add a few extra I should have time to write up some docs today :) |
Docs are done :D Unrelated: I was thinking about pulling out all of the error strings into constants at the top of |
I would love that, feel free to add contributions! In fact all help I can get is appreciated! Like I wrote in your issue and in this PR I feel bad for this linter to have fallen a bit behind (probably since it's a part of |
3543ba0
to
d5fc8c5
Compare
d5fc8c5
to
8036c23
Compare
Sorry for the force-pushes, just cleaning up some extra whitespace I noticed, didn't think they deserved their own commit :P I'm all finished with this PR if you have no further feedback :D I'll open a separate one for the error constants. |
No worries, force push all you want in your own branch, I don't like a messy git history either. Altough I'll probably squash when merging anyway so don't think too much about that :) |
35b3984
to
9f0780e
Compare
Everything seems to work as intended now!
I'll merge this but I'm not sure when I'll tag a new release. This isn't breaking since default is false but I think I want to test this out a bit since it's bundled with If you're using |
Yaay, thanks for the merge, and all your help with the code!! No worries on the release tagging. I do use |
For #65
This is the first time I've worked with an AST, it was pretty awesome... Sometimes frustrating.. but awesome :P
I set the new feature to Off by default.