Skip to content

chore: Update swiftlint to match stripe-ios#2407

Merged
yuki-stripe merged 1 commit intomasterfrom
yuki/match-swiftlint
Apr 27, 2026
Merged

chore: Update swiftlint to match stripe-ios#2407
yuki-stripe merged 1 commit intomasterfrom
yuki/match-swiftlint

Conversation

@yuki-stripe
Copy link
Copy Markdown
Collaborator

Summary

.

Testing

  • I tested this manually
  • I added automated tests
[I] yuki@st-yuki5 ~/s/stripe-react-native (yuki/match-swiftlint)> diff .swiftlint.yml ~/stripe/stripe-ios/.swiftlint.yml
3,5d2
< # Keep in sync with stripe-ios/.swiftlint.yml
< # (excluded paths and custom_rules may differ)
< #
15c12
<   - cyclomatic_complexity # This finds some hairy methods
---
>   - cyclomatic_complexity       # This finds some hairy methods
18c15
<   - function_body_length # Interesting overlap between these violations and cyclomatic_complexity
---
>   - function_body_length        # Interesting overlap between these violations and cyclomatic_complexity
35c32
<   - for_where
---
>   - for_where
73,74c70,75
<   - ios/Pods
<   - ios/build*
---
>   - Package.swift
>   - Pods
>   - Tests/installation_tests
>   - vendor
>   - build*
>   - .build
83c84
<   warning: 4 # It would be nice to lower this number
---
>   warning: 4                # It would be nice to lower this number
104c105
<   max_length: 30 # Maybe remove after initial cleanup.
---
>   max_length: 30          # Maybe remove after initial cleanup.
106a108,122
>   enum_safe_decodable:
>     name: "Use SafeEnumDecodable for enums"
>     message: "Enums in API Bindings should conform to SafeEnumDecodable or SafeEnumCodable instead of Decodable or Codable to handle unknown values gracefully."
>     regex: 'enum\s+(?!CodingKeys)\w+\s*(<[^>]*>)?\s*:\s*[^{]*(?<!SafeEnum)(Decodable|Codable)\b(?!Key)'
>     severity: error
>     included:
>       - "StripePaymentSheet/StripePaymentSheet/Source/Internal/API Bindings/"
>   no_shared_api_client_mutation_in_tests:
>     name: "Don't use STPAPIClient.shared in tests"
>     message: "Avoid setting STPAPIClient.shared.publishableKey in tests. Create a dedicated STPAPIClient instance instead to prevent test pollution. Note also that it's valid for merchants to pass their own instance of STPAPIClient and *not* use STPAPIClient.shared."
>     regex: 'STPAPIClient\.shared\.publishableKey\s*='
>     severity: warning
>     included:
>       - ".*Tests\\.swift$"
>       - ".*Tests/"

Documentation

Select one:

  • I have added relevant documentation for my changes.
  • This PR does not result in any developer-facing changes.

@yuki-stripe yuki-stripe requested review from a team as code owners April 22, 2026 22:59
@yuki-stripe yuki-stripe enabled auto-merge (squash) April 22, 2026 23:00
@yuki-stripe yuki-stripe changed the title Update swiftlint to match stripe-ios chore: Update swiftlint to match stripe-ios Apr 22, 2026
@yuki-stripe yuki-stripe force-pushed the yuki/match-swiftlint branch from 4cdf30b to 5874b93 Compare April 24, 2026 23:30
@yuki-stripe yuki-stripe merged commit 0c058e0 into master Apr 27, 2026
8 checks passed
@yuki-stripe yuki-stripe deleted the yuki/match-swiftlint branch April 27, 2026 21:08
Sign up for free to join this conversation on GitHub. Already have an account? Sign in to comment

Labels

None yet

Projects

None yet

Development

Successfully merging this pull request may close these issues.

2 participants