Treat warnings as errors except deprecations

Sorry to ask such a basic question, but is there a way currently to disable warning for dependencies (I'm using SPM). Currently, this leads to me ignoring warnings altogether because there's just so many of them.

Nope there isn't, and this is the problem :slight_smile:

1 Like

There's a difference between "disabling warnings for dependencies" and "disabling warnings for the use of dependencies". That's reasonable (though perhaps not the most secure idea), and separate from what we're discussing here. I suggest spinning off a different thread for that, since that'd be a SwiftPM feature.

We just found another case where being able to treat warnings as errors except deprecations would be very useful to us. We deprecated one API in our framework and we had to turn off completely the -warnings-as-errors in the test target since we want to keep the unit tests for the deprecated API:

Is there anything that would make it easier (or convince the Core team) to add such a feature in a future Swift release?

1 Like

I’ve encountered the same issue described by Patrick. The particular case of testing an otherwise deprecated api has made me wish for a way to silence a specific deprecation warning.

For the unit test problem, perhaps deprecation warnings could be automatically silenced when using declarations from a @testable import.

1 Like
Terms of Service

Privacy Policy

Cookie Policy