Skip to content
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

Merged
merged 6 commits into from
Nov 13, 2018

Conversation

danj-stripe
Copy link
Contributor

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 overwhelmingly URL.
stripeID beats stripeId 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.

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
Copy link
Contributor Author

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)
Copy link
Contributor Author

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.

@danj-stripe danj-stripe merged commit bd57e8d into master Nov 13, 2018
@danj-stripe danj-stripe deleted the danj/feature/all-caps-URL branch November 13, 2018 20:57
yuki-stripe pushed a commit that referenced this pull request May 3, 2022
BOUNCER-953 [StripeCardScan iOS] Remove the outer base64 encoding layer in the verification payload
Sign up for free to join this conversation on GitHub. Already have an account? Sign in to comment
Labels
Projects
None yet
Development

Successfully merging this pull request may close these issues.

3 participants