Bump ruff to latest version
Bump `ruff` to the latest version in a separate PR because of the big formatting change.
@mroeschke I wonder if it's reasonable to deprecate EX03 in favor of `ruff`'s autoformat of docstrings. 

If I understand correctly, EX03 is used to validate that a code block in a docstring follows PEP8. Currently EX03 is using `flake8` under the hood, which is no longer compatible with `ruff` (and `black`)'s 2024 style. 

In my opinion, we can just use `ruff` here. This should allow us to remove `flake8` as a dev requirement as well.

 > I wonder if it's reasonable to deprecate EX03 in favor of ruff's autoformat of docstrings.

I think there's momentum towards removing EX03. We can't right now since some docstrings are dynamically generated and `flake8` is performed those in a separate job (see `scripts/validate_docstrings.py`) @mroeschke how about adding E704 (Multiple statements on one line (def)) to the list of ignored errors for EX03? Currently there are `"--ignore=E203,E3,W503,W504,E402,E731,E128,E124"` > how about adding E704 (Multiple statements on one line (def)) to the list of ignored errors for EX03?

If that's the code that conflict with ruff's formating, that sounds good @mroeschke this PR should be ready for review, apart from the second commit, which is automatic, the rest are manual small fixes Thanks @tqa236 