-
Notifications
You must be signed in to change notification settings - Fork 4.2k
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
Final porting of functions to points and enforcement #39975
Merged
Merged
Conversation
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
Want to find functions with parameters that ought to be combined into a point or tripoint.
This should catch more cases where names match.
Don't want to port this one to use a point.
ifreund
approved these changes
Apr 29, 2020
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.
Thanks!
This was referenced May 3, 2020
Sign up for free
to join this conversation on GitHub.
Already have an account?
Sign in to comment
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.
Summary
SUMMARY: Infrastructure "Enforce that functions should not have separate x, y parameters"
Purpose of change
To improve type safety and clarity.
Working towards #32017.
Describe the solution
Convert the last few function parameters and members from separate
int
s topoint
s (as detected by my clang-tidy check).Add a new clang-tidy check to ensure that they do not return.
Describe alternatives you've considered
There was one function I have chosen to suppress rather than convert. I'm still a little torn as to whether it was the right choice.
Testing
Lots of running clang-tidy, and unit tests.
Additional context
As you can see from the commit dates on this branch, I wrote the new clang-tidy check in August. It's taken that long to work through all the warnings it raised.
This completes phase 2 of my
point
type safety master plan. The next phase is to convert local variables. I'm hoping that's more automatable than this phase was.(Actually, this completion is a slight lie; I know there are at least a couple of functions remaining that the current check misses. I may deal with those first).