Closed ecalifornica closed 1 month ago
All modified and coverable lines are covered by tests :white_check_mark:
Project coverage is 100.00%. Comparing base (
9aa8d98
) to head (5078419
). Report is 31 commits behind head on main.:exclamation: Current head 5078419 differs from pull request most recent head cd9e9e6
Please upload reports for the commit cd9e9e6 to get more accurate results.
:umbrella: View full report in Codecov by Sentry.
:loudspeaker: Have feedback on the report? Share it here.
This PR is stale because it has been open 30 days with no activity. Remove stale label or comment or this will be closed in 7 days.
This PR was closed because it has been stalled for 7 days with no activity.
This issue was closed by stalebot. It has been reopened to give more time for community review. See biocommons coding guidelines for stale issue and pull request policies. This resurrection is expected to be a onos.environ["GITHUB_TOKEN"]e-time event.
This PR is stale because it has been open 30 days with no activity. Remove stale label or comment or this will be closed in 7 days.
I'd add one thought here, in addition to my comment in #3 : Ruff development moves very quickly, and new rules are opted-in by default, which can cause headaches in CI (eg an aesthetic change like touching up the docs can fail because new code checks have been introduced). For this reason, we pin an exact Ruff version and have a policy of revisiting it about every 6 months.
This PR is stale because it has been open 30 days with no activity. Remove stale label or comment or this will be closed in 7 days.
This PR was closed because it has been stalled for 7 days with no activity.
There's some room for discussion about particular Ruff rules/configs. Experimentally, I think PTH
(here) will take the most work to implement, although I think it's worth it in the long run.
Note: I'm not totally sure how to handle testing of the boilerplate code contained here -- I noqa
'd it for now?
Other notes: I've left off two linting groups, flake8-annotations and flake8-pydocstyle because I think they'd be a big lift to achieve compliance with. Worth eventually implementing IMO.
@biocommons/maintainers did anyone else want to review this before it gets merged in?
edited description by @jsstevenson:
close #3
cqa
makefile target to do the same (just check), andreformat
target to actually format.Specific rule groupings selected (note that many specific rules also include auto-fixability -- so while they're nitpicky, they're also self-executing):
F, E, W
: the ~rough equivalent of base Flake8I
: isortN
: Pep8 naming. Rules for variable names. https://docs.astral.sh/ruff/rules/#pep8-naming-nUP
: PyUpgrade. Flags cases where newer Python versions have introduced features intended to replace what's been flagged. https://docs.astral.sh/ruff/rules/#pyupgrade-upYTT
: proper usage ofsys.version
https://docs.astral.sh/ruff/rules/#flake8-2020-yttS
: flake8-bandit, flags security issues https://docs.astral.sh/ruff/rules/#flake8-bandit-sB
: flake8-bugbear, flags common error-prone practices like using a multi-char string as an arg to.strip()
or mutable collections as default args https://docs.astral.sh/ruff/rules/#flake8-bugbear-bA
: flag variables that shadow builtins # https://docs.astral.sh/ruff/rules/#flake8-builtins-aC4
: best practices for comprehensions https://docs.astral.sh/ruff/rules/#flake8-comprehensions-c4DTZ
: best practice for datetimes # https://docs.astral.sh/ruff/rules/#flake8-datetimez-dtzEM
: don't provide literals to exceptions. I'm 50/50 on this one. https://docs.astral.sh/ruff/rules/#flake8-errmsg-emLOG
: logger best practices https://docs.astral.sh/ruff/rules/#flake8-logging-logG
: logger formatting best practices https://docs.astral.sh/ruff/rules/#flake8-logging-format-gPIE
: catch a few kinds of redundant or repetitive statements https://docs.astral.sh/ruff/rules/#flake8-pie-piePT
: pytest best practices # https://docs.astral.sh/ruff/rules/#flake8-pytest-style-ptRSE
:raise MyError()
->raise MyError
https://docs.astral.sh/ruff/rules/#flake8-raise-rseRET
: unnecessary/superfluous return/other kinds of control flow things # https://docs.astral.sh/ruff/rules/#flake8-return-retSIM
: simplify various kinds of compound statements (most autofixable) # https://docs.astral.sh/ruff/rules/#flake8-simplify-simARG
: unused args # https://docs.astral.sh/ruff/rules/#flake8-unused-arguments-argPTH
: force use of pathlib. This will entail # https://docs.astral.sh/ruff/rules/#flake8-use-pathlib-pthPL
: lots of pylint rules # https://docs.astral.sh/ruff/rules/#pylint-plTRY
: best practices around try/catch # https://docs.astral.sh/ruff/rules/#tryceratops-tryPERF
: some pretty simple performance goofs # https://docs.astral.sh/ruff/rules/#perflint-perfRUF
: custom rules original to Ruff. There's some interesting stuff here. https://docs.astral.sh/ruff/rules/#ruff-specific-rules-ruf