-
Notifications
You must be signed in to change notification settings - Fork 982
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
Change Styleguide around acronym capitalization, and fix recent PaymentIntent code #1037
Conversation
The capitalization recommendation it made is *not* being followed by the app. I specifically checked URL vs `Url`, and it's overwhelmingly `URL`. `stripeID` beats `stripeId` by about 2 to 1. You can see fully capitalized acronyms in class names too. I believe this better matches the actual style of the codebase, and will enable new code to be consistent with the old.
…leguide This was a fairly new API added about 4 months ago.
NSString *redirectURL = nextSourceAction[@"value"][@"url"]; | ||
return [self initWithNativeRedirectURL:nil | ||
redirectURL:[NSURL URLWithString:redirectURL] | ||
returnURL:paymentIntent.returnUrl |
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.
After this PR lands, the only case-sensitive search results for Url
are the returnUrl
property on STPPaymentIntent
.
That property is being removed for IOS-1013, so I left it unchanged in this PR.
@@ -18,7 +18,7 @@ | |||
|
|||
- Avoid single letter variables. Try using `idx` / `jdx` instead of `i` / `j` in for loops. | |||
|
|||
- Prefer `urlString` over `URLString` (acronym prefix), `baseUrlString` over `baseURLString` (acronym infix), and `stripeId` over `stripeID` (acronym suffix) |
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.
I'm not sure where this came from. It doesn't match the code. I took a shot at re-writing it to what I believe is the dominant style of the code base, but feedback on what the replacement should say would be great.
BOUNCER-953 [StripeCardScan iOS] Remove the outer base64 encoding layer in the verification payload
Summary
Fixes the styleguide to match the codebase, and updates recent code that was written
to follow the (incorrect) styleguide re: URL vs Url.
Only one public-facing property needed changing. Deprecated it, along with a fixit to
make the upgrade path easier for users. Everything else was private or test-only.
Motivation
I'd been following the STYLEGUIDE.md while working on the last PaymentIntent-related PRs.
While working on another PaymentIntent-related PR, I noticed the inconsistency, and
took the time to fix all of the
Url
cases.Testing
I specifically checked URL vs
Url
, and it was overwhelminglyURL
.stripeID
beatsstripeId
by about 2 to 1, but I'm not going to change them.You can see fully capitalized acronyms in class names too.
The automated tests verify no functionality change, and the fixit on the only
public-facing property worked to update the sample code.