Conversation
style: update ruff formatting and lint configs
|
@jsstevenson Great updates. Thanks. It appears to me that this change activates a bunch of new ruff tests. I'm concerned that tightening the screws too much right now will make it hard to adopt in repos because everything will fail out of the gate. (I realize that they won't be tested until they're changed.) Any comments on that concern? |
Totally. For context, my approach with style changes has been to take a rough guess at an ideal set of configs, take a run at implementing them in some core repos (hgvs, seqrepo, bioutils, anyvar), and then update the template proposal as I encounter lint rules that seem suboptimal or unnecessary. For seqrepo, bioutils, and anyvar, the PRs are fully complaint with the rules in this PR and all tests are passing (with the caveat that To take bioutils as an example: biocommons/bioutils#78. The majority of changes in that PR come from either precommit (e.g. trailing whitespace) or formatting/autofixing. There were a dozen or so cases of function type annotations to add, but I think we'd want to be checking in CI for adherence in any new code committed to the repo, so I felt okay about taking the time to bring the existing code into compliance. All of that being said, I'd be ok handling this PR and the downstream changes in individual repos myself after the core template is implemented. I think you'll find that |
close #56
A few notes
docs/(I think running linting and formatting on the Sphinxconf.pyfile is often more trouble than it's worth, for example) andbin/sbin(I'm usually hesitant to touch these when doing style commits in the biocommons repos because they don't have unit tests and might have specific uses I'm not privy to)toml-sortkinda messes up a lot of ways I'd prefer to be marking up the rule configs, maybe there's a way to suppress this but for now I just left it sparsetarget-version, ruff infers it from therequires-pythonvalue (which btw needs to be fixed). A couple of theformatsettings were just set to their default value.EMlint ruleset because @theferrit32 hates it