-
Notifications
You must be signed in to change notification settings - Fork 7
New issue
Have a question about this project? Sign up for a free GitHub account to open an issue and contact its maintainers and the community.
By clicking “Sign up for GitHub”, you agree to our terms of service and privacy statement. We’ll occasionally send you account related emails.
Already on GitHub? Sign in to your account
Review global Ruff and Pylint ignore rules #1181
Comments
Running
For all of the currently ignored rules the number of violations is relatively small and are typically confined to one or a few modules and should be quick to fix ( EDIT: Moving task list for invidual fixes to initial issue comment. To keep the changes minimal and easy to review / merge I'll create separate PRs for each of these. |
On a little bit of further thought, creating 7 separate PRs and triggerring multiple Actions workflows is possibly a bad idea and also may be more faff for reviewing so I'll create a PR with a commit per fix. |
Running
Many of these seem to be false positives. For example the As for Ruff rules, will add a task list for how to deal with each rule in first issue comment. |
Accidentally pressed close 😬 |
In #1158 we added a series of global Ruff and Pylint ignore rules to
pyproject.toml
TLOmodel/pyproject.toml
Lines 131 to 137 in e42bd48
TLOmodel/pyproject.toml
Lines 96 to 103 in e42bd48
to get the checks to pass without changing the current code. Ideally we should fix the underlying issues where possible, or where we think it's reasonable to violate the rule in a specific case change the global rule to a local
# noqa: ...
comment in the relevant part of the code.Ruff rule ignores task list
False
) violations and disable global ignorenot in
) violations and disable global ignoreis not
) violations and disable global ignoreisinstance
to compare types) violations and disable global ignorelambda
expression) violations and disable global ignorePylint rule ignores task list
tests/test_enhanced_lifestyle.py
andtests/test_rti.py
causing E1120 violations and remove global ignoreDateOffset
from public API intests/test_simplified_births.py
to fix E0611 violation and remove global ignoretests/test_healthburden.py
to avoid triggering E1101 and remove global ignoretests/test_bladder_cancer.py
,tests/test_breast_cancer.py
andsrc/tlo/util.py
and remove global ignoretests/test_determinism.py
to avoid triggering E1120 and remove global ignoresrc/tlo/methods/contraception.py
,src/tlo/methods/healthburden.py
andsrc/tlo/methods/hiv.py:3172
by usinginplace
variant of pandas function calls to avoid triggering E1136 / E1137 and remove global ignoreraise warnings.warn
insrc/tlo/methods/scenario_switcher.py
and remove global ignoresrc/tlo/analysis/utils.py
and remove global ignoresrc/tlo/logging/helpers.py
src/tlo/test/random_birth.py
involving accessing parameters directly as attribute of module (syntax was removed in Remove attribute based access of module parameters #378)The text was updated successfully, but these errors were encountered: