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

Optional dataType #140

Merged
merged 4 commits into from
Nov 17, 2022
Merged

Optional dataType #140

merged 4 commits into from
Nov 17, 2022

Conversation

chkpnt
Copy link
Contributor

@chkpnt chkpnt commented Nov 5, 2022

As discussed in #134

I've also added an additional initializer to simplify the mock creation in case a single non-get request has to be mocked.

@chkpnt
Copy link
Contributor Author

chkpnt commented Nov 6, 2022

That bot seems to live in the future. 😅

grafik

@wetransferplatform
Copy link
Collaborator

wetransferplatform commented Nov 6, 2022

Warnings
⚠️

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

Messages
📖

View more details on Bitrise

📖 No tests found for the current changes in build/reports

SwiftLint found issues

Severity File Reason
Warning MockerTests.swift:187 Line should be 140 characters or less: currently 151 characters (line_length)
Warning MockerTests.swift:205 Line should be 140 characters or less: currently 149 characters (line_length)
Warning MockerTests.swift:263 Line should be 140 characters or less: currently 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:544 Chained function calls should be either on the same line, or one per line. (multiline_function_chains)
Warning MockerTests.swift:578 Chained function calls should be either on the same line, or one per line. (multiline_function_chains)
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 Mock.swift:93 Computed properties should declare first 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 177 characters (line_length)
Error Mock.swift:38 Line should be 160 characters or less: currently 195 characters (line_length)
Warning Mock.swift:55 Line should be 140 characters or less: currently 155 characters (line_length)
Error Mock.swift:87 Line should be 160 characters or less: currently 211 characters (line_length)
Error Mock.swift:90 Line should be 160 characters or less: currently 208 characters (line_length)
Error Mock.swift:101 Line should be 160 characters or less: currently 217 characters (line_length)
Error Mock.swift:110 Line should be 160 characters or less: currently 297 characters (line_length)
Warning Mock.swift:116 Line should be 140 characters or less: currently 152 characters (line_length)
Warning Mock.swift:156 Line should be 140 characters or less: currently 141 characters (line_length)
Error Mock.swift:159 Line should be 160 characters or less: currently 171 characters (line_length)
Warning Mock.swift:178 Line should be 140 characters or less: currently 141 characters (line_length)
Warning Mock.swift:185 Line should be 140 characters or less: currently 142 characters (line_length)
Error Mock.swift:186 Line should be 160 characters or less: currently 246 characters (line_length)
Warning Mock.swift:204 Line should be 140 characters or less: currently 141 characters (line_length)
Error Mock.swift:206 Line should be 160 characters or less: currently 171 characters (line_length)
Error Mock.swift:211 Line should be 160 characters or less: currently 256 characters (line_length)
Warning Mock.swift:234 Line should be 140 characters or less: currently 150 characters (line_length)
Error Mock.swift:249 Line should be 160 characters or less: currently 171 characters (line_length)
Warning Mock.swift:253 Line should be 140 characters or less: currently 160 characters (line_length)
Warning Mock.swift:268 Line should be 140 characters or less: currently 141 characters (line_length)
Error Mock.swift:270 Line should be 160 characters or less: currently 171 characters (line_length)
Error Mock.swift:275 Line should be 160 characters or less: currently 262 characters (line_length)
Warning Mock.swift:326 Line should be 140 characters or less: currently 159 characters (line_length)
Error Mock.swift:336 Line should be 160 characters or less: currently 168 characters (line_length)
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)

Generated by 🚫 Danger Swift against 3b0bd4e

README.md Show resolved Hide resolved
Copy link
Contributor

@AvdLee AvdLee left a comment

Choose a reason for hiding this comment

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

Great job, I love how you went over all code and updated the documentation as well. For a second I figured we should validate and potentially assert to have a dataType if the status code is not matching an empty response, but I figured we would take too much responsibility. I like the flexibility we give right now!

I've got one nit, and our repository requires signed commits. Would it be possible for you to enable signed commits and recommit using the following command:

 git rebase --exec 'git commit --amend --no-edit -n -S' master
 git push --force

You can read more about setting up signed commits here.

Sources/Mocker/Mock.swift Show resolved Hide resolved
Sources/Mocker/Mock.swift Show resolved Hide resolved
@chkpnt chkpnt force-pushed the dataType branch 2 times, most recently from b6132a2 to bea1bf8 Compare November 7, 2022 10:28
@chkpnt
Copy link
Contributor Author

chkpnt commented Nov 7, 2022

The commits are now signed. :-)

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.

Awesome stuff, thanks @chkpnt!

Sources/Mocker/Mock.swift Outdated Show resolved Hide resolved
Sources/Mocker/Mock.swift Show resolved Hide resolved
@AvdLee
Copy link
Contributor

AvdLee commented Nov 15, 2022

@chkpnt thanks for signing the commits, you're almost there!
CleanShot 2022-11-15 at 11 27 04@2x

Can you finish that as well? 🙂

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.

It would be amazing if we could make this a non-breaking change. Let me know if that's something I can help with. :)

Sources/Mocker/Mock.swift Show resolved Hide resolved
Sources/Mocker/Mock.swift Outdated Show resolved Hide resolved
@chkpnt
Copy link
Contributor Author

chkpnt commented Nov 15, 2022

Now we have 7 public initializers, which all need to be maintained... 🫣

I guess it's time to introduce a builder. (probably out of scope of this PR?)

@chkpnt chkpnt requested a review from AvdLee November 15, 2022 22:20
@BasThomas
Copy link
Contributor

Now we have 7 public initializers, which all need to be maintained... 🫣

I guess it's time to introduce a builder. (probably out of scope of this PR?)

🙈

Yeah, I would say that is out of scope, but an interesting idea!

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.

Lookin' gooooood. Thanks so much for this, @chkpnt 🤩

A few small things I think we might want to tackle, and then I think this is good to go 👌

README.md Show resolved Hide resolved
Sources/Mocker/Mock.swift Outdated Show resolved Hide resolved
Sources/Mocker/Mock.swift Outdated Show resolved Hide resolved
Sources/Mocker/Mock.swift Outdated Show resolved Hide resolved
Sources/Mocker/Mock.swift Outdated Show resolved Hide resolved
Copy link
Contributor

@AvdLee AvdLee left a comment

Choose a reason for hiding this comment

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

Thanks a lot for the time and effort you put into making this PR shine! 💪

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.

💯 :shipit:

@BasThomas BasThomas merged commit e5b1e27 into WeTransfer:master Nov 17, 2022
@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