Expected behaviour
ruff check --fix --select SIM . should autofix
obj: dict = ...
key = ...
if key in obj:
value = obj[key]
else:
value = "Not found"
to this:
obj: dict = ...
key = ...
value = obj.get(key, "Not found")
Actual behaviour
ruff check --fix --select SIM . autofixes the above code to
obj: dict = ...
key = ...
value = obj[key] if key in obj else "Not found"
This happens because if-else-block-instead-of-if-exp (SIM108) autofixes before if-else-block-instead-of-dict-get (SIM401), and SIM401 does not flag violations in ternary operations.