exercism / elixir-analyzer

GNU Affero General Public License v3.0
30 stars 32 forks source link

Allow multiple `suppress_if` in all macros #327

Closed angelikatyborska closed 2 years ago

angelikatyborska commented 2 years ago

Currently you can only give a single check in suppress_if:

suppress_if Constants.solution_deprecated_random_module(), :fail

If would be great if it was possible to pass a list of checks too. If any of the checks on the list fulfills the requirement (pass/fail), the check that called suppress_if gets suppressed. This should work in all macros: assert_call, assert_no_call, assert_source, feature.

Example use case: for an assert call :rand.uniform, we would want to suppress the comment if somebody used the deprecated :random module instead, but also if somebody used the :rand.uniform_real function and in both cases provide a more detailed comment than in the base case of asserting a call of :rand.uniform.