@stripe/stripe-react-native 0.64.0 → 0.64.1

This diff represents the content of publicly available package versions that have been released to one of the supported registries. The information contained in this diff is provided for informational purposes only and reflects changes between package versions as they appear in their respective public registries.
Files changed (242) hide show
  1. package/README.md +2 -2
  2. package/android/build.gradle +2 -2
  3. package/android/detekt/detekt-baseline.xml +81 -0
  4. package/android/detekt/detekt.gradle +45 -0
  5. package/android/detekt/detekt.yml +722 -0
  6. package/android/gradle.properties +4 -4
  7. package/android/src/main/java/com/reactnativestripesdk/AuBECSDebitFormView.kt +3 -1
  8. package/android/src/main/java/com/reactnativestripesdk/AuBECSDebitFormViewManager.kt +2 -1
  9. package/android/src/main/java/com/reactnativestripesdk/CardFieldView.kt +5 -1
  10. package/android/src/main/java/com/reactnativestripesdk/CurrencySelectorElementView.kt +26 -0
  11. package/android/src/main/java/com/reactnativestripesdk/CurrencySelectorElementViewManager.kt +42 -0
  12. package/android/src/main/java/com/reactnativestripesdk/EmbeddedPaymentElementView.kt +105 -49
  13. package/android/src/main/java/com/reactnativestripesdk/EmbeddedPaymentElementViewManager.kt +72 -12
  14. package/android/src/main/java/com/reactnativestripesdk/FinancialConnectionsSheetManager.kt +8 -4
  15. package/android/src/main/java/com/reactnativestripesdk/GooglePayButtonManager.kt +2 -1
  16. package/android/src/main/java/com/reactnativestripesdk/GooglePayButtonView.kt +26 -11
  17. package/android/src/main/java/com/reactnativestripesdk/GooglePayLauncherManager.kt +2 -1
  18. package/android/src/main/java/com/reactnativestripesdk/NavigationBarView.kt +14 -5
  19. package/android/src/main/java/com/reactnativestripesdk/PaymentElementConfig.kt +6 -2
  20. package/android/src/main/java/com/reactnativestripesdk/PaymentLauncherManager.kt +2 -2
  21. package/android/src/main/java/com/reactnativestripesdk/PaymentMethodCreateParamsFactory.kt +2 -1
  22. package/android/src/main/java/com/reactnativestripesdk/PaymentMethodMessagingElementConfig.kt +7 -4
  23. package/android/src/main/java/com/reactnativestripesdk/PaymentMethodMessagingElementViewManager.kt +2 -1
  24. package/android/src/main/java/com/reactnativestripesdk/PaymentOptionDisplayDataMapper.kt +8 -4
  25. package/android/src/main/java/com/reactnativestripesdk/PaymentSheetAppearance.kt +9 -3
  26. package/android/src/main/java/com/reactnativestripesdk/PaymentSheetManager.kt +110 -29
  27. package/android/src/main/java/com/reactnativestripesdk/StripeSdkModule.kt +250 -12
  28. package/android/src/main/java/com/reactnativestripesdk/StripeSdkPackage.kt +1 -0
  29. package/android/src/main/java/com/reactnativestripesdk/addresssheet/AddressLauncherManager.kt +2 -1
  30. package/android/src/main/java/com/reactnativestripesdk/addresssheet/AddressSheetView.kt +3 -1
  31. package/android/src/main/java/com/reactnativestripesdk/customersheet/CustomerSheetManager.kt +6 -2
  32. package/android/src/main/java/com/reactnativestripesdk/customersheet/ReactNativeCustomerAdapter.kt +3 -1
  33. package/android/src/main/java/com/reactnativestripesdk/customersheet/ReactNativeCustomerSessionProvider.kt +2 -1
  34. package/android/src/main/java/com/reactnativestripesdk/pushprovisioning/AddToWalletButtonManager.kt +2 -1
  35. package/android/src/main/java/com/reactnativestripesdk/utils/CheckoutAddressUpdate.kt +45 -0
  36. package/android/src/main/java/com/reactnativestripesdk/utils/CheckoutMappers.kt +101 -0
  37. package/android/src/main/java/com/reactnativestripesdk/utils/Errors.kt +4 -2
  38. package/android/src/main/java/com/reactnativestripesdk/utils/Extensions.kt +5 -1
  39. package/android/src/main/java/com/reactnativestripesdk/utils/Mappers.kt +29 -17
  40. package/android/src/main/java/com/reactnativestripesdk/utils/PostalCodeUtilities.kt +2 -1
  41. package/android/src/oldarch/java/com/facebook/react/viewmanagers/EmbeddedPaymentElementViewManagerDelegate.java +6 -0
  42. package/android/src/oldarch/java/com/facebook/react/viewmanagers/EmbeddedPaymentElementViewManagerInterface.java +2 -0
  43. package/android/src/oldarch/java/com/facebook/react/viewmanagers/StripeCurrencySelectorElementManagerDelegate.java +35 -0
  44. package/android/src/oldarch/java/com/facebook/react/viewmanagers/StripeCurrencySelectorElementManagerInterface.java +18 -0
  45. package/android/src/oldarch/java/com/reactnativestripesdk/NativeStripeSdkModuleSpec.java +44 -0
  46. package/android/src/test/java/com/reactnativestripesdk/PaymentMethodMessagingElementConfigTest.kt +3 -3
  47. package/android/src/test/java/com/reactnativestripesdk/mappers/MappersTest.kt +60 -0
  48. package/android/src/test/java/com/reactnativestripesdk/mappers/OnrampMappersTest.kt +38 -0
  49. package/android/src/test/java/com/reactnativestripesdk/mappers/PaymentOptionDisplayDataMapperTest.kt +9 -4
  50. package/android/src/test/java/com/reactnativestripesdk/utils/CheckoutMappersTest.kt +89 -0
  51. package/android/src/test/java/com/reactnativestripesdk/utils/CheckoutTestFixtures.java +49 -0
  52. package/ios/ConnectAccountOnboarding/ConnectAccountOnboardingViewController.swift +6 -8
  53. package/ios/CurrencySelectorElementManager.m +9 -0
  54. package/ios/CurrencySelectorElementManager.swift +12 -0
  55. package/ios/CurrencySelectorElementView.swift +24 -0
  56. package/ios/Mappers+Checkout.swift +193 -0
  57. package/ios/Mappers.swift +0 -5
  58. package/ios/NewArch/EmbeddedPaymentElementViewComponentView.mm +16 -2
  59. package/ios/NewArch/StripeCurrencySelectorElementComponentView.h +10 -0
  60. package/ios/NewArch/StripeCurrencySelectorElementComponentView.mm +75 -0
  61. package/ios/PaymentMethodMessagingElementConfig.swift +6 -3
  62. package/ios/PaymentMethodMessagingElementView.swift +19 -0
  63. package/ios/StripeSdk.mm +123 -0
  64. package/ios/StripeSdkImpl+Checkout.swift +308 -0
  65. package/ios/StripeSdkImpl+Embedded.swift +108 -27
  66. package/ios/StripeSdkImpl+PaymentSheet.swift +18 -2
  67. package/ios/StripeSdkImpl.swift +3 -93
  68. package/jest/mock.js +14 -1
  69. package/lib/commonjs/components/AddToWalletButton.js +1 -1
  70. package/lib/commonjs/components/AddToWalletButton.js.map +1 -1
  71. package/lib/commonjs/components/AddressSheet.js +1 -1
  72. package/lib/commonjs/components/AddressSheet.js.map +1 -1
  73. package/lib/commonjs/components/AuBECSDebitForm.js +1 -1
  74. package/lib/commonjs/components/AuBECSDebitForm.js.map +1 -1
  75. package/lib/commonjs/components/CardField.js +1 -1
  76. package/lib/commonjs/components/CardField.js.map +1 -1
  77. package/lib/commonjs/components/CardForm.js +1 -1
  78. package/lib/commonjs/components/CardForm.js.map +1 -1
  79. package/lib/commonjs/components/CurrencySelectorElement.js +2 -0
  80. package/lib/commonjs/components/CurrencySelectorElement.js.map +1 -0
  81. package/lib/commonjs/components/PaymentMethodMessagingElement.js +2 -0
  82. package/lib/commonjs/components/PaymentMethodMessagingElement.js.map +1 -0
  83. package/lib/commonjs/components/PlatformPayButton.js +1 -1
  84. package/lib/commonjs/components/PlatformPayButton.js.map +1 -1
  85. package/lib/commonjs/components/StripeContainer.js +1 -1
  86. package/lib/commonjs/components/StripeContainer.js.map +1 -1
  87. package/lib/commonjs/connect/Components.js +1 -1
  88. package/lib/commonjs/connect/Components.js.map +1 -1
  89. package/lib/commonjs/connect/ConnectComponentsProvider.js +1 -1
  90. package/lib/commonjs/connect/ConnectComponentsProvider.js.map +1 -1
  91. package/lib/commonjs/connect/EmbeddedComponent.js +1 -1
  92. package/lib/commonjs/connect/EmbeddedComponent.js.map +1 -1
  93. package/lib/commonjs/connect/ModalCloseButton.js +1 -1
  94. package/lib/commonjs/connect/ModalCloseButton.js.map +1 -1
  95. package/lib/commonjs/connect/NavigationBar.js +1 -1
  96. package/lib/commonjs/connect/NavigationBar.js.map +1 -1
  97. package/lib/commonjs/events.js.map +1 -1
  98. package/lib/commonjs/functions.js +1 -1
  99. package/lib/commonjs/functions.js.map +1 -1
  100. package/lib/commonjs/helpers.js +1 -1
  101. package/lib/commonjs/hooks/useCheckout.js +2 -0
  102. package/lib/commonjs/hooks/useCheckout.js.map +1 -0
  103. package/lib/commonjs/hooks/useOnramp.js +1 -1
  104. package/lib/commonjs/hooks/useOnramp.js.map +1 -1
  105. package/lib/commonjs/index.js +1 -1
  106. package/lib/commonjs/index.js.map +1 -1
  107. package/lib/commonjs/specs/NativeAddToWalletButton.js +1 -1
  108. package/lib/commonjs/specs/NativeAddressSheet.js +1 -1
  109. package/lib/commonjs/specs/NativeApplePayButton.js +1 -1
  110. package/lib/commonjs/specs/NativeAuBECSDebitForm.js +1 -1
  111. package/lib/commonjs/specs/NativeCardField.js +1 -1
  112. package/lib/commonjs/specs/NativeCardField.js.map +1 -1
  113. package/lib/commonjs/specs/NativeCardForm.js +1 -1
  114. package/lib/commonjs/specs/NativeCardForm.js.map +1 -1
  115. package/lib/commonjs/specs/NativeConnectAccountOnboardingView.js +1 -1
  116. package/lib/commonjs/specs/NativeCurrencySelectorElement.js +2 -0
  117. package/lib/commonjs/specs/NativeCurrencySelectorElement.js.map +1 -0
  118. package/lib/commonjs/specs/NativeEmbeddedPaymentElement.js +1 -1
  119. package/lib/commonjs/specs/NativeEmbeddedPaymentElement.js.map +1 -1
  120. package/lib/commonjs/specs/NativeGooglePayButton.js +1 -1
  121. package/lib/commonjs/specs/NativeNavigationBar.js +1 -1
  122. package/lib/commonjs/specs/NativePaymentMethodMessagingElement.js +1 -1
  123. package/lib/commonjs/specs/NativePaymentMethodMessagingElement.js.map +1 -1
  124. package/lib/commonjs/specs/NativeStripeContainer.js +1 -1
  125. package/lib/commonjs/specs/NativeStripeSdkModule.js.map +1 -1
  126. package/lib/commonjs/types/Checkout.js +2 -0
  127. package/lib/commonjs/types/Checkout.js.map +1 -0
  128. package/lib/commonjs/types/EmbeddedPaymentElement.js +1 -1
  129. package/lib/commonjs/types/EmbeddedPaymentElement.js.map +1 -1
  130. package/lib/commonjs/types/PaymentSheet.js.map +1 -1
  131. package/lib/module/components/AddToWalletButton.js +1 -1
  132. package/lib/module/components/AddToWalletButton.js.map +1 -1
  133. package/lib/module/components/AddressSheet.js +1 -1
  134. package/lib/module/components/AddressSheet.js.map +1 -1
  135. package/lib/module/components/AuBECSDebitForm.js +1 -1
  136. package/lib/module/components/AuBECSDebitForm.js.map +1 -1
  137. package/lib/module/components/CardField.js +1 -1
  138. package/lib/module/components/CardField.js.map +1 -1
  139. package/lib/module/components/CardForm.js +1 -1
  140. package/lib/module/components/CardForm.js.map +1 -1
  141. package/lib/module/components/CurrencySelectorElement.js +2 -0
  142. package/lib/module/components/CurrencySelectorElement.js.map +1 -0
  143. package/lib/module/components/PaymentMethodMessagingElement.js +2 -0
  144. package/lib/module/components/PaymentMethodMessagingElement.js.map +1 -0
  145. package/lib/module/components/PlatformPayButton.js +1 -1
  146. package/lib/module/components/PlatformPayButton.js.map +1 -1
  147. package/lib/module/components/StripeContainer.js +1 -1
  148. package/lib/module/components/StripeContainer.js.map +1 -1
  149. package/lib/module/connect/Components.js +1 -1
  150. package/lib/module/connect/Components.js.map +1 -1
  151. package/lib/module/connect/ConnectComponentsProvider.js +1 -1
  152. package/lib/module/connect/ConnectComponentsProvider.js.map +1 -1
  153. package/lib/module/connect/EmbeddedComponent.js +1 -1
  154. package/lib/module/connect/EmbeddedComponent.js.map +1 -1
  155. package/lib/module/connect/ModalCloseButton.js +1 -1
  156. package/lib/module/connect/ModalCloseButton.js.map +1 -1
  157. package/lib/module/connect/NavigationBar.js +1 -1
  158. package/lib/module/connect/NavigationBar.js.map +1 -1
  159. package/lib/module/events.js.map +1 -1
  160. package/lib/module/functions.js +1 -1
  161. package/lib/module/functions.js.map +1 -1
  162. package/lib/module/helpers.js +1 -1
  163. package/lib/module/hooks/useCheckout.js +2 -0
  164. package/lib/module/hooks/useCheckout.js.map +1 -0
  165. package/lib/module/hooks/useOnramp.js +1 -1
  166. package/lib/module/hooks/useOnramp.js.map +1 -1
  167. package/lib/module/index.js +1 -1
  168. package/lib/module/index.js.map +1 -1
  169. package/lib/module/specs/NativeAddToWalletButton.js +1 -1
  170. package/lib/module/specs/NativeAddressSheet.js +1 -1
  171. package/lib/module/specs/NativeApplePayButton.js +1 -1
  172. package/lib/module/specs/NativeAuBECSDebitForm.js +1 -1
  173. package/lib/module/specs/NativeCardField.js +1 -1
  174. package/lib/module/specs/NativeCardField.js.map +1 -1
  175. package/lib/module/specs/NativeCardForm.js +1 -1
  176. package/lib/module/specs/NativeCardForm.js.map +1 -1
  177. package/lib/module/specs/NativeConnectAccountOnboardingView.js +1 -1
  178. package/lib/module/specs/NativeCurrencySelectorElement.js +2 -0
  179. package/lib/module/specs/NativeCurrencySelectorElement.js.map +1 -0
  180. package/lib/module/specs/NativeEmbeddedPaymentElement.js +1 -1
  181. package/lib/module/specs/NativeEmbeddedPaymentElement.js.map +1 -1
  182. package/lib/module/specs/NativeGooglePayButton.js +1 -1
  183. package/lib/module/specs/NativeNavigationBar.js +1 -1
  184. package/lib/module/specs/NativePaymentMethodMessagingElement.js +1 -1
  185. package/lib/module/specs/NativePaymentMethodMessagingElement.js.map +1 -1
  186. package/lib/module/specs/NativeStripeContainer.js +1 -1
  187. package/lib/module/specs/NativeStripeSdkModule.js.map +1 -1
  188. package/lib/module/types/Checkout.js +2 -0
  189. package/lib/module/types/Checkout.js.map +1 -0
  190. package/lib/module/types/EmbeddedPaymentElement.js +1 -1
  191. package/lib/module/types/EmbeddedPaymentElement.js.map +1 -1
  192. package/lib/module/types/PaymentSheet.js.map +1 -1
  193. package/lib/typescript/src/components/CurrencySelectorElement.d.ts +62 -0
  194. package/lib/typescript/src/components/CurrencySelectorElement.d.ts.map +1 -0
  195. package/lib/typescript/src/components/PaymentMethodMessagingElement.d.ts +41 -0
  196. package/lib/typescript/src/components/PaymentMethodMessagingElement.d.ts.map +1 -0
  197. package/lib/typescript/src/events.d.ts +11 -0
  198. package/lib/typescript/src/events.d.ts.map +1 -1
  199. package/lib/typescript/src/functions.d.ts.map +1 -1
  200. package/lib/typescript/src/hooks/useCheckout.d.ts +21 -0
  201. package/lib/typescript/src/hooks/useCheckout.d.ts.map +1 -0
  202. package/lib/typescript/src/hooks/useOnramp.d.ts +1 -0
  203. package/lib/typescript/src/hooks/useOnramp.d.ts.map +1 -1
  204. package/lib/typescript/src/index.d.ts +3 -0
  205. package/lib/typescript/src/index.d.ts.map +1 -1
  206. package/lib/typescript/src/specs/NativeCurrencySelectorElement.d.ts +25 -0
  207. package/lib/typescript/src/specs/NativeCurrencySelectorElement.d.ts.map +1 -0
  208. package/lib/typescript/src/specs/NativeEmbeddedPaymentElement.d.ts +5 -1
  209. package/lib/typescript/src/specs/NativeEmbeddedPaymentElement.d.ts.map +1 -1
  210. package/lib/typescript/src/specs/NativePaymentMethodMessagingElement.d.ts +1 -6
  211. package/lib/typescript/src/specs/NativePaymentMethodMessagingElement.d.ts.map +1 -1
  212. package/lib/typescript/src/specs/NativeStripeSdkModule.d.ts +16 -1
  213. package/lib/typescript/src/specs/NativeStripeSdkModule.d.ts.map +1 -1
  214. package/lib/typescript/src/types/Checkout.d.ts +336 -0
  215. package/lib/typescript/src/types/Checkout.d.ts.map +1 -0
  216. package/lib/typescript/src/types/EmbeddedPaymentElement.d.ts +36 -1
  217. package/lib/typescript/src/types/EmbeddedPaymentElement.d.ts.map +1 -1
  218. package/lib/typescript/src/types/PaymentMethod.d.ts +1 -5
  219. package/lib/typescript/src/types/PaymentMethod.d.ts.map +1 -1
  220. package/lib/typescript/src/types/PaymentSheet.d.ts +22 -6
  221. package/lib/typescript/src/types/PaymentSheet.d.ts.map +1 -1
  222. package/lib/typescript/src/types/components/PaymentMethodMessagingElementComponent.d.ts +16 -1
  223. package/lib/typescript/src/types/components/PaymentMethodMessagingElementComponent.d.ts.map +1 -1
  224. package/package.json +21 -7
  225. package/src/components/CurrencySelectorElement.tsx +95 -0
  226. package/src/components/PaymentMethodMessagingElement.tsx +109 -0
  227. package/src/events.ts +11 -0
  228. package/src/functions.ts +30 -1
  229. package/src/hooks/useCheckout.tsx +207 -0
  230. package/src/hooks/useOnramp.tsx +9 -3
  231. package/src/index.tsx +4 -0
  232. package/src/specs/NativeCurrencySelectorElement.ts +35 -0
  233. package/src/specs/NativeEmbeddedPaymentElement.ts +12 -2
  234. package/src/specs/NativePaymentMethodMessagingElement.ts +0 -7
  235. package/src/specs/NativeStripeSdkModule.ts +58 -1
  236. package/src/types/Checkout.ts +377 -0
  237. package/src/types/EmbeddedPaymentElement.tsx +117 -26
  238. package/src/types/PaymentMethod.ts +0 -6
  239. package/src/types/PaymentSheet.ts +29 -6
  240. package/src/types/components/PaymentMethodMessagingElementComponent.tsx +17 -1
  241. package/stripe-react-native.podspec +8 -8
  242. package/android/spotless.gradle +0 -19
@@ -0,0 +1,722 @@
1
+ config:
2
+ validation: true
3
+ warningsAsErrors: false
4
+ checkExhaustiveness: false
5
+ # when writing own rules with new properties, exclude the property path e.g.: ['my_rule_set', '.*>.*>[my_property]']
6
+ excludes: []
7
+
8
+ processors:
9
+ active: true
10
+ exclude:
11
+ - 'DetektProgressListener'
12
+ # - 'KtFileCountProcessor'
13
+ # - 'PackageCountProcessor'
14
+ # - 'ClassCountProcessor'
15
+ # - 'FunctionCountProcessor'
16
+ # - 'PropertyCountProcessor'
17
+ # - 'ProjectComplexityProcessor'
18
+ # - 'ProjectCognitiveComplexityProcessor'
19
+ # - 'ProjectLLOCProcessor'
20
+ # - 'ProjectCLOCProcessor'
21
+ # - 'ProjectLOCProcessor'
22
+ # - 'ProjectSLOCProcessor'
23
+ # - 'LicenseHeaderLoaderExtension'
24
+
25
+ console-reports:
26
+ active: true
27
+ exclude:
28
+ - 'ProjectStatisticsReport'
29
+ - 'ComplexityReport'
30
+ - 'NotificationReport'
31
+ # - 'IssuesReport'
32
+ - 'FileBasedIssuesReport'
33
+ - 'LiteIssuesReport'
34
+
35
+ comments:
36
+ active: true
37
+ AbsentOrWrongFileLicense:
38
+ active: false
39
+ licenseTemplate: ''
40
+ licenseTemplateIsRegex: false
41
+ DocumentationOverPrivateFunction:
42
+ active: false
43
+ DocumentationOverPrivateProperty:
44
+ active: false
45
+ DeprecatedBlockTag:
46
+ active: false
47
+ EndOfSentenceFormat:
48
+ active: false
49
+ endOfSentenceFormat: '([.?!][ \t\n\r\f<])|([.?!:]$)'
50
+ OutdatedDocumentation:
51
+ active: false
52
+ matchTypeParameters: true
53
+ matchDeclarationsOrder: true
54
+ UndocumentedPublicClass:
55
+ active: false
56
+ excludes: ['**/test/**', '**/androidTest/**', '**/commonTest/**', '**/jvmTest/**', '**/jsTest/**', '**/iosTest/**']
57
+ searchInNestedClass: true
58
+ searchInInnerClass: true
59
+ searchInInnerObject: true
60
+ searchInInnerInterface: true
61
+ UndocumentedPublicFunction:
62
+ active: false
63
+ excludes: ['**/test/**', '**/androidTest/**', '**/commonTest/**', '**/jvmTest/**', '**/jsTest/**', '**/iosTest/**']
64
+ UndocumentedPublicProperty:
65
+ active: false
66
+ excludes: ['**/test/**', '**/androidTest/**', '**/commonTest/**', '**/jvmTest/**', '**/jsTest/**', '**/iosTest/**']
67
+
68
+ complexity:
69
+ active: true
70
+ ComplexCondition:
71
+ active: true
72
+ allowedConditions: 4
73
+ ComplexInterface:
74
+ active: false
75
+ allowedDefinitions: 10
76
+ includeStaticDeclarations: false
77
+ includePrivateDeclarations: false
78
+ CyclomaticComplexMethod:
79
+ active: true
80
+ allowedComplexity: 15
81
+ ignoreSingleWhenExpression: false
82
+ ignoreSimpleWhenEntries: false
83
+ ignoreNestingFunctions: false
84
+ nestingFunctions:
85
+ - 'also'
86
+ - 'apply'
87
+ - 'forEach'
88
+ - 'isNotNull'
89
+ - 'ifNull'
90
+ - 'let'
91
+ - 'run'
92
+ - 'use'
93
+ - 'with'
94
+ LabeledExpression:
95
+ active: false
96
+ ignoredLabels: []
97
+ LargeClass:
98
+ active: true
99
+ allowedLines: 600
100
+ LongMethod:
101
+ active: true
102
+ allowedLines: 60
103
+ LongParameterList:
104
+ active: false
105
+ excludes: ['**/test/**', '**/androidTest/**', '**/commonTest/**', '**/jvmTest/**', '**/jsTest/**', '**/iosTest/**']
106
+ allowedFunctionParameters: 6
107
+ allowedConstructorParameters: 7
108
+ ignoreDefaultParameters: true
109
+ ignoreDataClasses: true
110
+ ignoreAnnotatedParameter: []
111
+ MethodOverloading:
112
+ active: false
113
+ allowedOverloads: 6
114
+ NamedArguments:
115
+ active: false
116
+ allowedArguments: 3
117
+ NestedBlockDepth:
118
+ active: true
119
+ allowedDepth: 4
120
+ ReplaceSafeCallChainWithRun:
121
+ active: false
122
+ StringLiteralDuplication:
123
+ active: false
124
+ excludes: ['**/test/**', '**/androidTest/**', '**/commonTest/**', '**/jvmTest/**', '**/jsTest/**', '**/iosTest/**']
125
+ allowedDuplications: 3
126
+ ignoreAnnotation: true
127
+ allowedWithLengthLessThan: 5
128
+ ignoreStringsRegex: '$^'
129
+ TooManyFunctions:
130
+ active: true
131
+ excludes: ['**/test/**', '**/androidTest/**', '**/commonTest/**', '**/jvmTest/**', '**/jsTest/**', '**/iosTest/**']
132
+ allowedFunctionsPerFile: 11
133
+ allowedFunctionsPerClass: 11
134
+ allowedFunctionsPerInterface: 11
135
+ allowedFunctionsPerObject: 11
136
+ allowedFunctionsPerEnum: 11
137
+ ignoreDeprecated: false
138
+ ignorePrivate: true
139
+ ignoreOverridden: false
140
+
141
+ coroutines:
142
+ active: true
143
+ GlobalCoroutineUsage:
144
+ active: false
145
+ InjectDispatcher:
146
+ active: false
147
+ dispatcherNames:
148
+ - 'IO'
149
+ - 'Default'
150
+ - 'Unconfined'
151
+ RedundantSuspendModifier:
152
+ active: false
153
+ SleepInsteadOfDelay:
154
+ active: false
155
+ SuspendFunWithFlowReturnType:
156
+ active: false
157
+
158
+ empty-blocks:
159
+ active: true
160
+ EmptyCatchBlock:
161
+ active: true
162
+ allowedExceptionNameRegex: '_|(ignore|expected).*'
163
+ EmptyClassBlock:
164
+ active: true
165
+ EmptyDefaultConstructor:
166
+ active: true
167
+ EmptyDoWhileBlock:
168
+ active: true
169
+ EmptyElseBlock:
170
+ active: true
171
+ EmptyFinallyBlock:
172
+ active: true
173
+ EmptyForBlock:
174
+ active: true
175
+ EmptyFunctionBlock:
176
+ active: true
177
+ ignoreOverridden: false
178
+ EmptyIfBlock:
179
+ active: true
180
+ EmptyInitBlock:
181
+ active: true
182
+ EmptyKotlinFile:
183
+ active: true
184
+ EmptySecondaryConstructor:
185
+ active: true
186
+ EmptyTryBlock:
187
+ active: true
188
+ EmptyWhenBlock:
189
+ active: true
190
+ EmptyWhileBlock:
191
+ active: true
192
+
193
+ exceptions:
194
+ active: true
195
+ ExceptionRaisedInUnexpectedLocation:
196
+ active: true
197
+ methodNames:
198
+ - 'equals'
199
+ - 'finalize'
200
+ - 'hashCode'
201
+ - 'toString'
202
+ InstanceOfCheckForException:
203
+ active: false
204
+ excludes: ['**/test/**', '**/androidTest/**', '**/commonTest/**', '**/jvmTest/**', '**/jsTest/**', '**/iosTest/**']
205
+ NotImplementedDeclaration:
206
+ active: false
207
+ ObjectExtendsThrowable:
208
+ active: false
209
+ PrintStackTrace:
210
+ active: true
211
+ RethrowCaughtException:
212
+ active: true
213
+ ReturnFromFinally:
214
+ active: true
215
+ ignoreLabeled: false
216
+ SwallowedException:
217
+ active: true
218
+ ignoredExceptionTypes:
219
+ - 'InterruptedException'
220
+ - 'MalformedURLException'
221
+ - 'NumberFormatException'
222
+ - 'ParseException'
223
+ allowedExceptionNameRegex: '_|(ignore|expected).*'
224
+ ThrowingExceptionFromFinally:
225
+ active: true
226
+ ThrowingExceptionInMain:
227
+ active: false
228
+ ThrowingExceptionsWithoutMessageOrCause:
229
+ active: true
230
+ excludes: ['**/test/**', '**/androidTest/**', '**/commonTest/**', '**/jvmTest/**', '**/jsTest/**', '**/iosTest/**']
231
+ exceptions:
232
+ - 'ArrayIndexOutOfBoundsException'
233
+ - 'Exception'
234
+ - 'IllegalArgumentException'
235
+ - 'IllegalMonitorStateException'
236
+ - 'IllegalStateException'
237
+ - 'IndexOutOfBoundsException'
238
+ - 'NullPointerException'
239
+ - 'RuntimeException'
240
+ - 'Throwable'
241
+ ThrowingNewInstanceOfSameException:
242
+ active: true
243
+ TooGenericExceptionCaught:
244
+ active: true
245
+ excludes: ['**/test/**', '**/androidTest/**', '**/commonTest/**', '**/jvmTest/**', '**/jsTest/**', '**/iosTest/**']
246
+ exceptionNames:
247
+ - 'ArrayIndexOutOfBoundsException'
248
+ - 'Error'
249
+ - 'Exception'
250
+ - 'IllegalMonitorStateException'
251
+ - 'IndexOutOfBoundsException'
252
+ - 'NullPointerException'
253
+ - 'RuntimeException'
254
+ - 'Throwable'
255
+ allowedExceptionNameRegex: '_|(ignore|expected).*'
256
+ TooGenericExceptionThrown:
257
+ active: true
258
+ exceptionNames:
259
+ - 'Error'
260
+ - 'Exception'
261
+ - 'RuntimeException'
262
+ - 'Throwable'
263
+
264
+ naming:
265
+ active: true
266
+ BooleanPropertyNaming:
267
+ active: false
268
+ excludes: ['**/test/**', '**/androidTest/**', '**/commonTest/**', '**/jvmTest/**', '**/jsTest/**', '**/iosTest/**']
269
+ allowedPattern: '^(is|has|are)'
270
+ ClassNaming:
271
+ active: true
272
+ excludes: ['**/test/**', '**/androidTest/**', '**/commonTest/**', '**/jvmTest/**', '**/jsTest/**', '**/iosTest/**']
273
+ classPattern: '[A-Z][a-zA-Z0-9]*'
274
+ ConstructorParameterNaming:
275
+ active: true
276
+ excludes: ['**/test/**', '**/androidTest/**', '**/commonTest/**', '**/jvmTest/**', '**/jsTest/**', '**/iosTest/**']
277
+ parameterPattern: '[a-z][A-Za-z0-9]*'
278
+ privateParameterPattern: '[a-z][A-Za-z0-9]*'
279
+ excludeClassPattern: '$^'
280
+ EnumNaming:
281
+ active: true
282
+ excludes: ['**/test/**', '**/androidTest/**', '**/commonTest/**', '**/jvmTest/**', '**/jsTest/**', '**/iosTest/**']
283
+ enumEntryPattern: '[A-Z][_a-zA-Z0-9]*'
284
+ ForbiddenClassName:
285
+ active: false
286
+ excludes: ['**/test/**', '**/androidTest/**', '**/commonTest/**', '**/jvmTest/**', '**/jsTest/**', '**/iosTest/**']
287
+ forbiddenName: []
288
+ FunctionNameMaxLength:
289
+ active: false
290
+ excludes: ['**/test/**', '**/androidTest/**', '**/commonTest/**', '**/jvmTest/**', '**/jsTest/**', '**/iosTest/**']
291
+ maximumFunctionNameLength: 30
292
+ FunctionNameMinLength:
293
+ active: false
294
+ excludes: ['**/test/**', '**/androidTest/**', '**/commonTest/**', '**/jvmTest/**', '**/jsTest/**', '**/iosTest/**']
295
+ minimumFunctionNameLength: 3
296
+ FunctionNaming:
297
+ active: true
298
+ excludes: ['**/test/**', '**/androidTest/**', '**/commonTest/**', '**/jvmTest/**', '**/jsTest/**', '**/iosTest/**']
299
+ functionPattern: '([a-zA-Z][a-zA-Z0-9]*)|(`.*`)'
300
+ excludeClassPattern: '$^'
301
+ FunctionParameterNaming:
302
+ active: true
303
+ excludes: ['**/test/**', '**/androidTest/**', '**/commonTest/**', '**/jvmTest/**', '**/jsTest/**', '**/iosTest/**']
304
+ parameterPattern: '[a-z][A-Za-z0-9]*'
305
+ excludeClassPattern: '$^'
306
+ InvalidPackageDeclaration:
307
+ active: false
308
+ rootPackage: ''
309
+ LambdaParameterNaming:
310
+ active: false
311
+ excludes: ['**/test/**', '**/androidTest/**', '**/commonTest/**', '**/jvmTest/**', '**/jsTest/**', '**/iosTest/**']
312
+ parameterPattern: '[a-z][A-Za-z0-9]*|_'
313
+ MatchingDeclarationName:
314
+ active: true
315
+ mustBeFirst: true
316
+ MemberNameEqualsClassName:
317
+ active: true
318
+ ignoreOverridden: true
319
+ NoNameShadowing:
320
+ active: false
321
+ NonBooleanPropertyPrefixedWithIs:
322
+ active: false
323
+ excludes: ['**/test/**', '**/androidTest/**', '**/commonTest/**', '**/jvmTest/**', '**/jsTest/**', '**/iosTest/**']
324
+ ObjectPropertyNaming:
325
+ active: true
326
+ excludes: ['**/test/**', '**/androidTest/**', '**/commonTest/**', '**/jvmTest/**', '**/jsTest/**', '**/iosTest/**']
327
+ constantPattern: '[A-Za-z][_A-Za-z0-9]*'
328
+ propertyPattern: '[A-Za-z][_A-Za-z0-9]*'
329
+ privatePropertyPattern: '(_)?[A-Za-z][_A-Za-z0-9]*'
330
+ PackageNaming:
331
+ active: true
332
+ excludes: ['**/test/**', '**/androidTest/**', '**/commonTest/**', '**/jvmTest/**', '**/jsTest/**', '**/iosTest/**']
333
+ packagePattern: '[a-z]+(\.[a-z][A-Za-z0-9]*)*'
334
+ TopLevelPropertyNaming:
335
+ active: true
336
+ excludes: ['**/test/**', '**/androidTest/**', '**/commonTest/**', '**/jvmTest/**', '**/jsTest/**', '**/iosTest/**']
337
+ constantPattern: '[A-Z][_A-Za-z0-9]*'
338
+ propertyPattern: '[A-Za-z][_A-Za-z0-9]*'
339
+ privatePropertyPattern: '_?[A-Za-z][_A-Za-z0-9]*'
340
+ VariableMaxLength:
341
+ active: false
342
+ excludes: ['**/test/**', '**/androidTest/**', '**/commonTest/**', '**/jvmTest/**', '**/jsTest/**', '**/iosTest/**']
343
+ maximumVariableNameLength: 64
344
+ VariableMinLength:
345
+ active: false
346
+ excludes: ['**/test/**', '**/androidTest/**', '**/commonTest/**', '**/jvmTest/**', '**/jsTest/**', '**/iosTest/**']
347
+ minimumVariableNameLength: 1
348
+ VariableNaming:
349
+ active: true
350
+ excludes: ['**/test/**', '**/androidTest/**', '**/commonTest/**', '**/jvmTest/**', '**/jsTest/**', '**/iosTest/**']
351
+ variablePattern: '[a-z][A-Za-z0-9]*'
352
+ privateVariablePattern: '(_)?[a-z][A-Za-z0-9]*'
353
+ excludeClassPattern: '$^'
354
+
355
+ performance:
356
+ active: true
357
+ ArrayPrimitive:
358
+ active: true
359
+ ForEachOnRange:
360
+ active: true
361
+ excludes: ['**/test/**', '**/androidTest/**', '**/commonTest/**', '**/jvmTest/**', '**/jsTest/**', '**/iosTest/**']
362
+ SpreadOperator:
363
+ active: true
364
+ excludes: ['**/test/**', '**/androidTest/**', '**/commonTest/**', '**/jvmTest/**', '**/jsTest/**', '**/iosTest/**']
365
+ UnnecessaryTemporaryInstantiation:
366
+ active: true
367
+
368
+ potential-bugs:
369
+ active: true
370
+ AvoidReferentialEquality:
371
+ active: false
372
+ forbiddenTypePatterns:
373
+ - 'kotlin.String'
374
+ CastToNullableType:
375
+ active: false
376
+ Deprecation:
377
+ active: false
378
+ DontDowncastCollectionTypes:
379
+ active: false
380
+ DoubleMutabilityForCollection:
381
+ active: false
382
+ EqualsAlwaysReturnsTrueOrFalse:
383
+ active: true
384
+ EqualsWithHashCodeExist:
385
+ active: true
386
+ ExitOutsideMain:
387
+ active: false
388
+ ExplicitGarbageCollectionCall:
389
+ active: true
390
+ HasPlatformType:
391
+ active: false
392
+ IgnoredReturnValue:
393
+ active: false
394
+ restrictToConfig: true
395
+ returnValueAnnotations:
396
+ - '*.CheckResult'
397
+ - '*.CheckReturnValue'
398
+ ignoreReturnValueAnnotations:
399
+ - '*.CanIgnoreReturnValue'
400
+ ImplicitDefaultLocale:
401
+ active: true
402
+ ImplicitUnitReturnType:
403
+ active: false
404
+ allowExplicitReturnType: true
405
+ InvalidRange:
406
+ active: true
407
+ IteratorHasNextCallsNextMethod:
408
+ active: true
409
+ IteratorNotThrowingNoSuchElementException:
410
+ active: true
411
+ LateinitUsage:
412
+ active: false
413
+ excludes: ['**/test/**', '**/androidTest/**', '**/commonTest/**', '**/jvmTest/**', '**/jsTest/**', '**/iosTest/**']
414
+ ignoreOnClassesPattern: ''
415
+ MapGetWithNotNullAssertionOperator:
416
+ active: false
417
+ MissingPackageDeclaration:
418
+ active: false
419
+ excludes: ['**/*.kts']
420
+ NullableToStringCall:
421
+ active: false
422
+ UnconditionalJumpStatementInLoop:
423
+ active: false
424
+ UnnecessaryNotNullOperator:
425
+ active: true
426
+ UnnecessarySafeCall:
427
+ active: true
428
+ UnreachableCatchBlock:
429
+ active: false
430
+ UnreachableCode:
431
+ active: true
432
+ UnsafeCallOnNullableType:
433
+ active: true
434
+ excludes: ['**/test/**', '**/androidTest/**', '**/commonTest/**', '**/jvmTest/**', '**/jsTest/**', '**/iosTest/**']
435
+ UnsafeCast:
436
+ active: true
437
+ UnusedUnaryOperator:
438
+ active: false
439
+ UselessPostfixExpression:
440
+ active: false
441
+ WrongEqualsTypeParameter:
442
+ active: true
443
+
444
+ style:
445
+ active: true
446
+ AbstractClassCanBeConcreteClass:
447
+ active: true
448
+ AbstractClassCanBeInterface:
449
+ active: true
450
+ BracesOnIfStatements:
451
+ active: false
452
+ singleLine: 'never'
453
+ multiLine: 'always'
454
+ ClassOrdering:
455
+ active: false
456
+ CollapsibleIfStatements:
457
+ active: false
458
+ DataClassContainsFunctions:
459
+ active: false
460
+ conversionFunctionPrefix:
461
+ - 'to'
462
+ DataClassShouldBeImmutable:
463
+ active: false
464
+ DestructuringDeclarationWithTooManyEntries:
465
+ active: false
466
+ maxDestructuringEntries: 3
467
+ EqualsNullCall:
468
+ active: true
469
+ EqualsOnSignatureLine:
470
+ active: false
471
+ ExplicitCollectionElementAccessMethod:
472
+ active: false
473
+ ExplicitItLambdaMultipleParameters:
474
+ active: false
475
+ ExplicitItLambdaParameter:
476
+ active: false
477
+ ExpressionBodySyntax:
478
+ active: false
479
+ includeLineWrapping: false
480
+ ForbiddenComment:
481
+ active: true
482
+ comments:
483
+ - reason: 'Forbidden FIXME todo marker in comment, please fix the problem.'
484
+ value: 'FIXME:'
485
+ - reason: 'Forbidden STOPSHIP todo marker in comment, please address the problem before shipping the code.'
486
+ value: 'STOPSHIP:'
487
+ - reason: 'Forbidden TODO todo marker in comment, please do the changes.'
488
+ value: 'TODO:'
489
+ allowedPatterns: ''
490
+ ForbiddenImport:
491
+ active: false
492
+ forbiddenImports: []
493
+ allowedImports: []
494
+ ForbiddenMethodCall:
495
+ active: false
496
+ methods:
497
+ - 'kotlin.io.print'
498
+ - 'kotlin.io.println'
499
+ ForbiddenVoid:
500
+ active: false
501
+ ignoreOverridden: false
502
+ ignoreUsageInGenerics: false
503
+ FunctionOnlyReturningConstant:
504
+ active: true
505
+ ignoreOverridableFunction: true
506
+ ignoreActualFunction: true
507
+ excludedFunctions: []
508
+ LoopWithTooManyJumpStatements:
509
+ active: true
510
+ maxJumpCount: 1
511
+ MagicNumber:
512
+ active: true
513
+ excludes: ['**/test/**', '**/androidTest/**', '**/commonTest/**', '**/jvmTest/**', '**/jsTest/**', '**/iosTest/**']
514
+ ignoreNumbers:
515
+ - '-1'
516
+ - '0'
517
+ - '1'
518
+ - '2'
519
+ ignoreHashCodeFunction: true
520
+ ignorePropertyDeclaration: true
521
+ ignoreLocalVariableDeclaration: false
522
+ ignoreConstantDeclaration: true
523
+ ignoreCompanionObjectPropertyDeclaration: true
524
+ ignoreAnnotation: false
525
+ ignoreNamedArgument: true
526
+ ignoreEnums: false
527
+ ignoreRanges: false
528
+ ignoreExtensionFunctions: true
529
+ MandatoryBracesLoops:
530
+ active: false
531
+ MaxLineLength:
532
+ active: true
533
+ maxLineLength: 120
534
+ excludePackageStatements: true
535
+ excludeImportStatements: true
536
+ excludeCommentStatements: false
537
+ MayBeConstant:
538
+ active: true
539
+ ModifierOrder:
540
+ active: true
541
+ MultilineLambdaItParameter:
542
+ active: false
543
+ NestedClassesVisibility:
544
+ active: true
545
+ NewLineAtEndOfFile:
546
+ active: true
547
+ NoTabs:
548
+ active: false
549
+ ObjectLiteralToLambda:
550
+ active: false
551
+ OptionalAbstractKeyword:
552
+ active: true
553
+ OptionalUnit:
554
+ active: false
555
+ ProtectedMemberInFinalClass:
556
+ active: true
557
+ RangeUntilInsteadOfRangeTo:
558
+ active: false
559
+ RedundantExplicitType:
560
+ active: false
561
+ RedundantHigherOrderMapUsage:
562
+ active: false
563
+ RedundantVisibilityModifier:
564
+ active: false
565
+ ReturnCount:
566
+ active: false
567
+ SafeCast:
568
+ active: true
569
+ SerialVersionUIDInSerializableClass:
570
+ active: true
571
+ SpacingAfterPackageDeclaration:
572
+ active: false
573
+ ThrowsCount:
574
+ active: true
575
+ max: 2
576
+ excludeGuardClauses: false
577
+ TrailingWhitespace:
578
+ active: false
579
+ UnderscoresInNumericLiterals:
580
+ active: false
581
+ acceptableLength: 4
582
+ UnnecessaryApply:
583
+ active: true
584
+ UnnecessaryFilter:
585
+ active: false
586
+ UnnecessaryInheritance:
587
+ active: true
588
+ UnnecessaryLet:
589
+ active: false
590
+ UnnecessaryParentheses:
591
+ active: false
592
+ UnusedImport:
593
+ active: true
594
+ UnusedPrivateClass:
595
+ active: true
596
+ UnusedPrivateFunction:
597
+ active: true
598
+ allowedNames: '(_|ignored|expected|serialVersionUID)'
599
+ UnusedPrivateProperty:
600
+ active: true
601
+ allowedNames: '(_|ignored|expected|serialVersionUID)'
602
+ UnusedParameter:
603
+ active: true
604
+ allowedNames: '(_|ignored|expected|serialVersionUID)'
605
+ UnusedVariable:
606
+ active: true
607
+ allowedNames: '(_|ignored|expected|serialVersionUID)'
608
+ UseAnyOrNoneInsteadOfFind:
609
+ active: false
610
+ UseArrayLiteralsInAnnotations:
611
+ active: false
612
+ UseCheckNotNull:
613
+ active: false
614
+ UseCheckOrError:
615
+ active: false
616
+ UseDataClass:
617
+ active: false
618
+ allowVars: false
619
+ UseEmptyCounterpart:
620
+ active: false
621
+ UseIfEmptyOrIfBlank:
622
+ active: false
623
+ UseIfInsteadOfWhen:
624
+ active: false
625
+ UseIsNullOrEmpty:
626
+ active: false
627
+ UseOrEmpty:
628
+ active: false
629
+ UseRequire:
630
+ active: false
631
+ UseRequireNotNull:
632
+ active: false
633
+ UselessCallOnNotNull:
634
+ active: true
635
+ UtilityClassWithPublicConstructor:
636
+ active: true
637
+ VarCouldBeVal:
638
+ active: true
639
+ WildcardImport:
640
+ active: true
641
+ excludes: ['**/test/**', '**/androidTest/**', '**/commonTest/**', '**/jvmTest/**', '**/jsTest/**', '**/iosTest/**']
642
+ excludeImports:
643
+ - 'java.util.*'
644
+
645
+ # Rules from detekt-rules-ktlint-wrapper. Disabled rules should match .editorconfig.
646
+ ktlint:
647
+ Annotation:
648
+ active: false
649
+ AnnotationOnSeparateLine:
650
+ active: false
651
+ ArgumentListWrapping:
652
+ active: false
653
+ BackingPropertyNaming:
654
+ active: false
655
+ BinaryExpressionWrapping:
656
+ active: false
657
+ BlankLineBeforeDeclaration:
658
+ active: false
659
+ BlankLineBetweenWhenConditions:
660
+ active: false
661
+ ChainMethodContinuation:
662
+ active: false
663
+ ClassSignature:
664
+ active: false
665
+ EnumWrapping:
666
+ active: false
667
+ FunctionExpressionBody:
668
+ active: false
669
+ FunctionLiteral:
670
+ active: false
671
+ FunctionNaming:
672
+ active: false
673
+ FunctionReturnTypeSpacing:
674
+ active: false
675
+ FunctionSignature:
676
+ active: false
677
+ IfElseWrapping:
678
+ active: false
679
+ ImportOrdering:
680
+ active: true
681
+ Indentation:
682
+ active: false
683
+ Kdoc:
684
+ active: false
685
+ MaximumLineLength:
686
+ active: false
687
+ MixedConditionOperators:
688
+ active: false
689
+ MultilineExpressionWrapping:
690
+ active: false
691
+ NoConsecutiveComments:
692
+ active: false
693
+ NoEmptyFirstLineInClassBody:
694
+ active: false
695
+ NoSemicolons:
696
+ active: false
697
+ NoSingleLineBlockComment:
698
+ active: false
699
+ PackageName:
700
+ active: false
701
+ ParameterListSpacing:
702
+ active: false
703
+ ParameterListWrapping:
704
+ active: false
705
+ PropertyName:
706
+ active: false
707
+ StatementWrapping:
708
+ active: false
709
+ StringTemplateIndent:
710
+ active: false
711
+ TrailingCommaOnCallSite:
712
+ active: false
713
+ TrailingCommaOnDeclarationSite:
714
+ active: false
715
+ TryCatchFinallySpacing:
716
+ active: false
717
+ TypeParameterListSpacing:
718
+ active: false
719
+ ValueParameterComment:
720
+ active: false
721
+ WhenEntryBracing:
722
+ active: false