Skip to content
New issue

Have a question about this project? Sign up for a free GitHub account to open an issue and contact its maintainers and the community.

By clicking “Sign up for GitHub”, you agree to our terms of service and privacy statement. We’ll occasionally send you account related emails.

Already on GitHub? Sign in to your account

Generated code import ordering is random #856

Open
dbushong opened this issue Feb 13, 2024 · 1 comment
Open

Generated code import ordering is random #856

dbushong opened this issue Feb 13, 2024 · 1 comment
Labels
pull request welcome A pull request is welcome to fix this issue

Comments

@dbushong
Copy link

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. a dict()). 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.

@dbushong dbushong changed the title Generated code is not stable Generated code import ordering is random Feb 13, 2024
@sbrunner sbrunner added the pull request welcome A pull request is welcome to fix this issue label Feb 14, 2024
@sbrunner
Copy link
Owner

Personally, I'm not concerned because I do an isort on the generate code via a pre-commit :-)

Sign up for free to join this conversation on GitHub. Already have an account? Sign in to comment
Labels
pull request welcome A pull request is welcome to fix this issue
Projects
None yet
Development

No branches or pull requests

2 participants