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

Simplify tests and add Sendable to subtypes #150

Merged
merged 1 commit into from
Jan 5, 2024
Merged

Conversation

AvdLee
Copy link
Contributor

@AvdLee AvdLee commented Jan 2, 2024

In an attempt to make Mocker conform to Sendable, I realized it's not making much sense for the nature of this project. Any mutations to Mock are done before the mock is registered and right now, it does not make any sense to change properties after registration.

If we would make Mock conform to Sendable, we would have to make all its properties including closures Sendable too. This would cause a huge impact on codebases since our tests are using onRequest handlers and others while capturing many non-sendable types. Therefore, I don't think it makes sense for this project, for testing purposes designed, to conform to Sendable in the short term.

Yet, I did add a few conformances that don't hurt 👌

@wetransferplatform
Copy link
Collaborator

Warnings
⚠️

Consider to place some MARK: lines for Sources/Mocker/Mock.swift, which is over 300 lines big.

Messages
📖

View more details on Bitrise

SwiftLint found issues

Severity File Reason
Warning Mock.swift:9 The disabled 'force_unwrapping' rule should be re-enabled before the end of the file (blanket_disable_command)
Warning Mock.swift:93 Computed properties should first declare the getter and then the setter (computed_accessors_order)
Error Mock.swift:111 Prefer checking isEmpty over comparing count to zero (empty_count)
Error Mock.swift:8 Line should be 160 characters or less; currently it has 177 characters (line_length)
Error Mock.swift:38 Line should be 160 characters or less; currently it has 195 characters (line_length)
Warning Mock.swift:55 Line should be 140 characters or less; currently it has 155 characters (line_length)
Error Mock.swift:87 Line should be 160 characters or less; currently it has 211 characters (line_length)
Error Mock.swift:90 Line should be 160 characters or less; currently it has 208 characters (line_length)
Error Mock.swift:101 Line should be 160 characters or less; currently it has 217 characters (line_length)
Error Mock.swift:110 Line should be 160 characters or less; currently it has 297 characters (line_length)
Warning Mock.swift:116 Line should be 140 characters or less; currently it has 152 characters (line_length)
Warning Mock.swift:156 Line should be 140 characters or less; currently it has 141 characters (line_length)
Error Mock.swift:159 Line should be 160 characters or less; currently it has 171 characters (line_length)
Warning Mock.swift:178 Line should be 140 characters or less; currently it has 141 characters (line_length)
Warning Mock.swift:185 Line should be 140 characters or less; currently it has 142 characters (line_length)
Error Mock.swift:186 Line should be 160 characters or less; currently it has 246 characters (line_length)
Warning Mock.swift:204 Line should be 140 characters or less; currently it has 141 characters (line_length)
Error Mock.swift:206 Line should be 160 characters or less; currently it has 171 characters (line_length)
Error Mock.swift:211 Line should be 160 characters or less; currently it has 256 characters (line_length)
Warning Mock.swift:234 Line should be 140 characters or less; currently it has 150 characters (line_length)
Error Mock.swift:249 Line should be 160 characters or less; currently it has 171 characters (line_length)
Warning Mock.swift:253 Line should be 140 characters or less; currently it has 160 characters (line_length)
Warning Mock.swift:268 Line should be 140 characters or less; currently it has 141 characters (line_length)
Error Mock.swift:270 Line should be 160 characters or less; currently it has 171 characters (line_length)
Error Mock.swift:275 Line should be 160 characters or less; currently it has 262 characters (line_length)
Warning Mock.swift:326 Line should be 140 characters or less; currently it has 159 characters (line_length)
Error Mock.swift:336 Line should be 160 characters or less; currently it has 168 characters (line_length)
Warning Mock.swift:129 Use shorthand syntax for optional binding (shorthand_optional_binding)
Warning Mock.swift:338 Use shorthand syntax for optional binding (shorthand_optional_binding)
Warning Mock.swift:338 Use shorthand syntax for optional binding (shorthand_optional_binding)
Warning Mock.swift:42 Lines should not have trailing whitespace (trailing_whitespace)
Warning Mock.swift:114 Lines should not have trailing whitespace (trailing_whitespace)
Warning Mock.swift:155 Lines should not have trailing whitespace (trailing_whitespace)
Warning Mock.swift:199 Lines should not have trailing whitespace (trailing_whitespace)
Warning Mock.swift:224 Lines should not have trailing whitespace (trailing_whitespace)
Warning Mock.swift:244 Lines should not have trailing whitespace (trailing_whitespace)
Warning Mock.swift:263 Lines should not have trailing whitespace (trailing_whitespace)
Warning MockerTests.swift:187 Line should be 140 characters or less; currently it has 151 characters (line_length)
Warning MockerTests.swift:205 Line should be 140 characters or less; currently it has 149 characters (line_length)
Warning MockerTests.swift:263 Line should be 140 characters or less; currently it has 157 characters (line_length)
Warning MockerTests.swift:52 Chained function calls should be either on the same line, or one per line (multiline_function_chains)
Warning MockerTests.swift:71 Chained function calls should be either on the same line, or one per line (multiline_function_chains)
Warning MockerTests.swift:94 Chained function calls should be either on the same line, or one per line (multiline_function_chains)
Warning MockerTests.swift:116 Chained function calls should be either on the same line, or one per line (multiline_function_chains)
Warning MockerTests.swift:148 Chained function calls should be either on the same line, or one per line (multiline_function_chains)
Warning MockerTests.swift:173 Chained function calls should be either on the same line, or one per line (multiline_function_chains)
Warning MockerTests.swift:189 Chained function calls should be either on the same line, or one per line (multiline_function_chains)
Warning MockerTests.swift:207 Chained function calls should be either on the same line, or one per line (multiline_function_chains)
Warning MockerTests.swift:230 Chained function calls should be either on the same line, or one per line (multiline_function_chains)
Warning MockerTests.swift:283 Chained function calls should be either on the same line, or one per line (multiline_function_chains)
Warning MockerTests.swift:548 Chained function calls should be either on the same line, or one per line (multiline_function_chains)
Warning MockerTests.swift:582 Chained function calls should be either on the same line, or one per line (multiline_function_chains)
Warning MockerTests.swift:261 Variables should not have redundant type annotation (redundant_type_annotation)
Warning MockerTests.swift:132 Use shorthand syntax for optional binding (shorthand_optional_binding)
Warning MockerTests.swift:267 Use shorthand syntax for optional binding (shorthand_optional_binding)
Warning MockerTests.swift:536 Use shorthand syntax for optional binding (shorthand_optional_binding)
Warning MockerTests.swift:152 Lines should not have trailing whitespace (trailing_whitespace)
Warning MockerTests.swift:167 Lines should not have trailing whitespace (trailing_whitespace)
Warning MockerTests.swift:15 Type body should span 400 lines or less excluding comments and whitespace: currently spans 445 lines (type_body_length)
Warning MockerTests.swift:48 Parentheses are not needed when declaring closure arguments (unneeded_parentheses_in_closure_argument)
Warning MockerTests.swift:67 Parentheses are not needed when declaring closure arguments (unneeded_parentheses_in_closure_argument)
Warning MockerTests.swift:90 Parentheses are not needed when declaring closure arguments (unneeded_parentheses_in_closure_argument)
Warning MockerTests.swift:112 Parentheses are not needed when declaring closure arguments (unneeded_parentheses_in_closure_argument)
Warning MockerTests.swift:130 Parentheses are not needed when declaring closure arguments (unneeded_parentheses_in_closure_argument)
Warning MockerTests.swift:162 Parentheses are not needed when declaring closure arguments (unneeded_parentheses_in_closure_argument)
Warning MockerTests.swift:185 Parentheses are not needed when declaring closure arguments (unneeded_parentheses_in_closure_argument)
Warning MockerTests.swift:203 Parentheses are not needed when declaring closure arguments (unneeded_parentheses_in_closure_argument)
Warning MockerTests.swift:226 Parentheses are not needed when declaring closure arguments (unneeded_parentheses_in_closure_argument)
Warning MockerTests.swift:242 Parentheses are not needed when declaring closure arguments (unneeded_parentheses_in_closure_argument)
Warning MockerTests.swift:265 Parentheses are not needed when declaring closure arguments (unneeded_parentheses_in_closure_argument)
Warning MockerTests.swift:531 Parentheses are not needed when declaring closure arguments (unneeded_parentheses_in_closure_argument)
Warning MockerTests.swift:574 Parentheses are not needed when declaring closure arguments (unneeded_parentheses_in_closure_argument)

Generated by 🚫 Danger Swift against d4014d0

Copy link
Contributor

@BasThomas BasThomas left a comment

Choose a reason for hiding this comment

The reason will be displayed to describe this comment to others. Learn more.

👌

@AvdLee AvdLee enabled auto-merge January 3, 2024 09:42
@AvdLee AvdLee merged commit edf95a4 into master Jan 5, 2024
4 checks passed
@AvdLee AvdLee deleted the feature/sendable branch January 5, 2024 10:16
@wetransferplatform
Copy link
Collaborator

Congratulations! 🎉 This was released as part of Release 3.0.2 🚀

Generated by GitBuddy

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.

4 participants