Repository navigation
[TECH DEBT] ruff and mypy rollout on master (tracking) #70384
charzl
started this conversation in
Feature Requests
Replies: 0 comments
Sign up for free
to join this conversation on GitHub.
Already have an account?
Sign in to comment
Uh oh!
There was an error while loading. Please reload this page.
Description of the tech debt to be addressed, include links and screenshots
Tracking issue for rolling out ruff and mypy on
master. Background and discussion are in #70367.Approach
master. 3006 only gets security fixes and 3007 is EOL, so nothing is backported. 3008 is left alone for now.ruff format) and the rules that overlap withpyupgrade/isortstay off.masterin small PRs, avoiding files that get bug fixes often.Baseline (master at
f37cdcd1c9, ruff 0.16.10, mypy 2.4.0,salt/withoutsalt/ext)F: 8442 findings, 8094 of them areF821on loader dunders (__salt__,__opts__, ...). With the dunders declared as builtins: 459 left (242 unused variable, 91 unused import, 111 undefined name; 74 of those arenapalm_device).B: 1122 findings (869 areB904). Not planned for the first step.salt/, about 3 seconds.--check-untyped-defsonsalt/utilsalone: 1488 errors. This is where the real work is, so it is not part of the first steps.The dunder list used for the numbers above is a guess. It needs to be checked against what the loader actually injects.
Steps
pyproject.tomlwithFonly, loader dunders (andnapalm_device) declared as builtins,salt/extexcludedF821findings that are not injected names (e.g.exc,get_conninsalt/cloud/libcloudfuncs.py) and fix or file bugstools/tosalt/(default settings,follow_imports = silent), with the loader dunders declared oncecheck_untyped_defsor more ruff rules for selected modulesNot in scope
salt/modulesandsalt/statesin bulk.salt/ext.Versions Report
N/A (tooling)
All reactions