Open axel-h opened 7 months ago
It looks like what we need is autopep8 v2.0.4
(which is currently the latest). The package sel4-deps
in the seL4 repo sets autopep8==1.4.3
.
Not sure if there will be flow-on effects from that, but we could upgrade that.
The same package also pins cmake-format
, which from time to time was showing stupid formatting. Could try to upgrade that too, but all of this may lead to style failures. Hopefully only at the points that previously were stupid, but we should probably at least try to check if those versions do something fundamentally different.
So, playing around with it a bit locally, the latest version of autopep8
does upgrade one dependency which doesn't seem to be a problem, and it does have impact on a small number of our python files, but everything I have seen are actual fixes that it should have done that way in the first place.
So I'd be up for bumping that version.
Still need to investigate cmake-format
.
@Ivan-Velickovic I remember you having trouble with autopep8
crashing -- would that potentially be alleviated by bumping the style checks to the latest version? Or do you expect more trouble from that?
I can't remember exactly but based on this https://github.com/seL4/microkit/pull/67#issuecomment-1886369351 comment I think it was fine. Using the newer version didn't (at least for that code) do a bunch of incompatible/extra styling so at least for my purposes upgrading the version shouldn't cause trouble.
Result of playing with cmake-format
versions: their output differs fairly strongly. If we decide to upgrade, that should definitely be a separate discussion and needs to be weighed carefully against the noise it is going to produce in commits. The latest version is 0.6.13. Development seems to have slowed down, at least there hasn't been a new version since 2021 (and plenty before). That version has slightly different config options with more customisability, so it might be possible to get something nicer for those cases that are currently annoying, but at least in < 15min I wasn't able to find a combination that produces only small diffs to what we have now.
So: separate discussion for cmake-format
, and if nobody objects, I would upgrade autopep8
to the latest version which fixes some crashes and seems mostly layout-stable. Pinging @seL4/tsc in case people want to weigh in on that.
When
seL4/ci-actions/style@master
runs, it fails with this internal error. Which may indicate there is a style issue in my code, but it seem the checker itself runs into a version problem:It seem this issue is known, see https://github.com/hhatto/autopep8/issues/689. But now I am a bit lost how to solve this. Can we fix this in
scripts/install-python.sh
and force a specific version or do we need python 3.11?