Closed apirogov closed 11 months ago
Thanks for the report, I agree that the output should be deterministic. It already is in the ordering of fields in a map but not yet in the ordering of objects in a sequence, I'll implement a solution for it.
Should be fixed and released now
Great! Thanks for fixing this and all the others issues! I will test the new version once I have a bit of time in the coming days/weeks :)
I'm using codemetapy as a linter with
pre-commit
and noticed that for some reason it fails sometimes because thecodemeta.json
file changed.In my case, this is caused by my classifiers:
Then codemetapy will randomly orders them, sometimes resulting in:
and sometimes in:
Would it be possible to make sure that a consistent order is ensured?
As a workaround I currently add a global
exclude: '^codemeta.json$'
to my hook, which is not nice because it prevents my JSON linter to format the JSON.Expected behavior
On the same input files exactly the same output file should be generated.