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

Remove try! from test code #4865

Open
armcknight opened this issue Feb 18, 2025 · 3 comments
Open

Remove try! from test code #4865

armcknight opened this issue Feb 18, 2025 · 3 comments

Comments

@armcknight
Copy link
Member

Description

Previously I've removed potential crashers in test code in #4125 and #4132, but I guess I didn't think to look for this. Just noticed it, and we currently have 69 instances. Most should be an easy conversion of the enclosing test cases to throws, but a few are property intializers on Fixture instances that will need a little more work to maybe change to optional types.

@philipphofmann
Copy link
Member

If we can't make it in a big bang, we should tackle this opportunistically. Whenever we change a test class that uses try!, we can remove it. We should enable the swiftlint rule to avoid having try! again in the future, once we ditched all of these.

@philprime
Copy link
Contributor

I agree that we should tackle this and enable the swiftlint rule. Maybe it's worth splitting up the refactoring for tests and for SDK into two PRs, as one affects the changelog while the other doesn't

@philipphofmann
Copy link
Member

We don't use try! in the SDK code. We only hjave in the test code. The swiftlint rule is active for SDK code,

- force_try

@philprime philprime moved this from Needs Discussion to Backlog in Mobile & Cross Platform SDK Feb 19, 2025
Sign up for free to join this conversation on GitHub. Already have an account? Sign in to comment
Projects
Status: Backlog
Development

No branches or pull requests

3 participants