Improve update ruff

Chosson Ulysse requested to merge IMPROVE_update_ruff into main

Update ruff and correct new issue.

Ruff now support pattern matching, use pattern matching instead if when it's possible

Merge request reports