Shopify / deprecation_toolkit

⚒Eliminate deprecations from your codebase ⚒
MIT License
454 stars 40 forks source link

Add allowed warnings behavior #96

Closed IvanTakarlikov-st closed 5 months ago

IvanTakarlikov-st commented 6 months ago

This PR adds .allowed_warnings configuration option that allows to skip warning if it's throwing from your codebase and you need to have it throwed along with threating rest of warnings as deprecations.

IvanTakarlikov-st commented 5 months ago

@Edouard-chin @byroot @casperisfine can I ask you for a review please?

casperisfine commented 5 months ago

Sorry, but I don't understand the point of this feature. Do you have a concrete use case?

IvanTakarlikov-st commented 5 months ago

@casperisfine yes, we raising some warnings for developers in our use codebase. And we don't want to get it ignored and don't want to get it treated as deprecations. We just want to keep those warnings behavior as it was before.

IvanTakarlikov-st commented 5 months ago

@casperisfine and at the same time we want to have all other warnings to be treated as deprecations. So, it's kinda allowlist for case when we use warnings_treated_as_deprecations = [//]

casperisfine commented 5 months ago

I see. Then I think changing =~ for === without adding a second list would be more flexible. That would allow you to use any callable to make complex matching.