Open dbushong opened 8 months ago
Personally, I'm not concerned because I do an isort
on the generate code via a pre-commit :-)
This is causing us a bit of trouble when running the tool via pre-commit, because pre-commit will say the check has "failed" on the basis of it having changed a file, even if the only change is that the order of the imports has swapped around.
I've opened a quick PR to address this with a sorted()
.
The list of imports are collected in a
set()
(I believe) and so their ordering is not stable. We should either sort them when emitting code or use a stable method of making them unique (e.g. adict()
). Having the code change every time it is regenerated makes for undesirable diff churn when generated code is checked into a repo and regularly regenerated as part of automated tooling.