microsoft / python-type-stubs

A set of type stubs for popular Python packages. These are works in progress from the Microsoft Python team and others, with the intent that they are contributed to typeshed or to the associated packages once sufficiently complete.
MIT License
251 stars 99 forks source link

Apply pyupgrade autofixes #341

Open Avasam opened 2 weeks ago

Avasam commented 2 weeks ago

(based on https://github.com/microsoft/python-type-stubs/pull/339, so merge that one first) Done

I added UP to Ruff's select. https://docs.astral.sh/ruff/rules/#pyupgrade-up (and ignored two rules known to be problematic) Then run ruff check --fix --unsafe-fixes --preview: Found 1078 errors (993 fixed, 85 remaining). Then ignore the checks still failing to keep this PR to automated fixes only. (because Ruff has no config to set as warning: https://github.com/astral-sh/ruff/issues/1256)

Note that flake8-future-annotations (FA) was already passing on main, so I just included it.