-
Notifications
You must be signed in to change notification settings - Fork 33
Description
so I was setting up local dev and ran ruff with default rules out of curiosity. ci.yml runs ruff with --select=E9,F63,F7,F82 which is just... syntax errors that's it, the actual state of the codebase:
$ ruff check . --statistics
57 E722 bare-except
32 F401 unused-import
30 E703 useless-semicolon
22 E741 ambiguous-variable-name
14 E701 multiple-statements-on-one-line
5 F541 f-string-missing-placeholders
...
Found 189 errors.
vs what CI flags: 18. the 57 bare except: clauses are the real problem,, they're actively hiding bugs in the simulation loop. stuff fails silently and you have no idea.
also ruff format --check reports 80 files would be reformatted. CI never runs the format check at all, so formatting is just vibes at this point.
pytest-cov is sitting in requirements-dev.txt doing nothing. neither workflow uses --cov. we have no idea if a PR is quietly deleting test coverage.
there's also two separate workflows (ci.yml and tests.yml) that both run pytest but with completely different dep installs, tests.yml pulls in tensorflow and cvxopt from requirements.txt which makes it slow and is going to break on Python 3.12 eventually. they should just be one workflow using requirements-ci.txt which already exists for this exact reason.
no ruff.toml either so there's no shared config, whatever editor you use, whatever flags you pass locally, it's all different from what CI does.
what actually needs to happen:
-
ruff.toml with real rules, exclude the legacy dirs (demo/, ratc/, example/)
-
bump CI ruff to E + F at minimum, add a format check step
-
wire pytest --cov ,no 100% target, just don't let it regress
-
merge tests.yml into ci.yml, drop the tensorflow install
-
.pre-commit-config.yaml so this is caught before it even hits CI
-
fix the bare excepts in core files, rest can be done incrementally