-
-
Notifications
You must be signed in to change notification settings - Fork 565
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
Generated gRPC comments are merged with prior closing brace #3681
Comments
Makes sense! would you be able to create a PR to fix the missing newline? Unfortunately there's no simple rule one can apply as to whether a template should or should not end with a newline as it depends on its usage. Also Goa will apply |
This is what prevented me from creating a PR. Is there a short summary version of the rule that I could use to identify this, or would it be a matter of trying to find where each template is used and assessing it? As a matter of mechanics, I would propose rules like this to increase the uniformity of the files and the visibility of exceptions:
This recommendation can be tweaked if, say, the last line needs to include a trailing space.
Right, |
I like the proposal! Historically we were trying to have the generated code formatted correctly independently of |
In several places this results in the comment for the next section becoming a trailing comment on the prior syntax. For example in gen/grpc/*/client/client.go, diffed against the output from an embarassingly old version of goa:
I believe this is due to missing newlines at the end of the template files. (The http client_init.go.tpl ends in
7d
0a
; the grpc client_init.go.tpl ends in7d
.)I'm unclear why the current templates have a mix of present and missing final newlines. I suspect they should at least be more similar between http and grpc, if not just always have them. Alternately, perhaps readTemplate should ensure a trailing newline.
The text was updated successfully, but these errors were encountered: