Open LefterisJP opened 1 year ago
Since the issue is still open, is this still on the table? I think most PTH
rules have no autofixes yet
It seems there are no more open PRs on this topic
Certainly on the table, just needs someone to work on it. It may also be limited by our ability to do program-wide analysis beyond simple fixes.
Should the tag type-inference
be added?
It may also be limited by our ability to do program-wide analysis beyond simple fixes.
Most of the fixes seem simple enough to me, i.e.
PTH102 "os.mkdir() should be replaced by Path.mkdir()"
os.mkdir(var, kwargs)
becomes
Path(var).mkdir(kwargs)
I may be missing something - not sure how it could affect a broader scope of code.
Yeah we can do simple stuff like tha, although I think the spirit of the rule is that you'd changed var
to be of type Path
more holistically in the code, then do var.mkdir(kwargs)
.
I enabled PTH rules and there was a few hits in rotki's codebase.
This is a rule I woud like to enforce but there is quite many places it hit and I suppose at least some of the rules should be autofixable. So if possible it would be cool to have ruff do it for us.