-
Notifications
You must be signed in to change notification settings - Fork 56
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
Add --no-field-prefix
option
#228
Open
ccycle
wants to merge
6
commits into
awakesecurity:master
Choose a base branch
from
ccycle:no-field-prefix
base: master
Could not load branches
Branch not found: {{ refName }}
Loading
Could not load tags
Nothing to show
Loading
Are you sure you want to change the base?
Some commits from the old base branch may be removed from the timeline,
and old review comments may become outdated.
+283
−228
Open
Changes from 2 commits
Commits
Show all changes
6 commits
Select commit
Hold shift + click to select a range
8ee46de
Add `--no-field-prefix`
ccycle 9197b19
Remove field selectors in tests
ccycle 70cead3
Use `Set` in keywords list
ccycle 3e7b7ed
Add keyword check
ccycle 4fc88a7
Merge commit 'b0a3308d9d1b1b070c371f90de984ff192020537' into no-field…
ccycle 58acd42
Fix help message
ccycle File filter
Filter by extension
Conversations
Failed to load comments.
Loading
Jump to
Jump to file
Failed to load files.
Loading
Diff view
Diff view
There are no files selected for viewing
This file contains bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
This file contains bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
Oops, something went wrong.
Add this suggestion to a batch that can be applied as a single commit.
This suggestion is invalid because no changes were made to the code.
Suggestions cannot be applied while the pull request is closed.
Suggestions cannot be applied while viewing a subset of changes.
Only one suggestion per line can be applied in a batch.
Add this suggestion to a batch that can be applied as a single commit.
Applying suggestions on deleted lines is not supported.
You must change the existing code in this line in order to create a valid suggestion.
Outdated suggestions cannot be applied.
This suggestion has been applied or marked resolved.
Suggestions cannot be applied from pending reviews.
Suggestions cannot be applied on multi-line comments.
Suggestions cannot be applied while the pull request is queued to merge.
Suggestion cannot be applied right now. Please check back 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.
Do you need a keyword check in this function too?
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.
This is needed for the same reason in this comment (#228 (comment)), since the function is used in generating service field name and needed to avoid parse error.
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.
OK, so if it is needed, then could you add it?
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 for your comment, I added a commit including changes you requested. Could you please review for that?
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.
Does
prefixedMethodNameWithFlag
also need a keyword check?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.
@j6carey Sorry I forgot including the commit, I'll add it.
@riz0id Thank you for the review. I'm not sure I follow your opinion correctly, but I also agree adding
hs_name
option and removing the part of my changes to avoid colliding with keywords.I have a question about this part. In this PR, should the use of
toCamelCase
be avoided, or allowed temporally to consider that it will be removed in the future?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.
In this PR and until we have a
hs_name
option, we should stick to the naming convention rules that the rest ofproto3-suite
uses for record selector names which is what you do here withtoCamelCase
. In the future though, when we have facilities to override names in generated Haskell code, we will probably make breaking changes to instead use snake case for records. Currently the number of edge cases that need to be considered in order to rename protobuf names to camel case Haskell identifiers is getting out of hand. Using snake case record selectors makes a lot more sense (imo) since:tldr; Yes use
toCamelCase
for now, but onceproto3-suite
supports ahs_name
option expect breaking changes that use snake case for message field names.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.
@riz0id OK, thanks. I also think that it is nice to control field selector names with the
hs_name
option and use snake case record selectors.@j6carey I added some changes, could you take a look at this?
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.
My concerns have been addressed, but @riz0id , did you want the keyword checks eliminated, or are they OK until
hs_name
is available?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.
@riz0id Do you have any remaining concerns?