-
-
Notifications
You must be signed in to change notification settings - Fork 8
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
Normalize declarations #30
Conversation
fe72ce8
to
79102a9
Compare
@junedev did you have a change to have a look? |
@tehsphinx No, since I don't have a good grasp of AST parsing and the representer code, it would take me quite some time to do any kind of sensible review. Didn't have that time yet. I'm ok with this being waved through by the admins though as we anyway need to do some more testing before taking the whole thing live. |
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.
Just one point I noticed scrolling through: It would be great if the test cases could have names of what they check, e.g. that would make it easier to describe the normalizations in documentation later on. Also would be good to include a test case for the things we might not handle currently like var err error
or var a SomeStruct
to ensure that does not cause any issues in the representation.
@junedev I think the review could be mostly about checking the test cases ( The test names I think we can update in another MR (to keep things separate). Good point! |
@ErikSchierboom Can you stamp this? The representer is not live yet and we can do more testing later. |
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.
Sure
Implements declaration normalization as suggested here: #26 (comment)
The cases it normalizes can best be seen in
testdata/declarations
or in the comment mentioned above. The basic idea is to use:=
declarations for everything and one line per declaration.There is one case that could be normalized around declarations which this MR does NOT cover: