krzema12 / kotlin-python

Python target for the Kotlin Programming Language. See https://github.com/krzema12/kotlin-python/tree/python-backend/python
https://discuss.kotlinlang.org/t/idea-python-backend/19852
48 stars 1 forks source link

Simplify diffing outputs in build #30

Closed krzema12 closed 3 years ago

krzema12 commented 3 years ago

Simplify diffing outputs in build

The newly generated files are put under the same path as the committed files, and thanks to it it's possible to leverage git to check if the file changed. It has at least two benefits:


Depends on #29.

krzema12 commented 3 years ago

I realized that relying on git diff is unsafe. Why: imagine that we want to check if file foo.txt changed, but accidentally write the new output during CI build into doo.txt. A new file is created and showing what changed for foo.txt shows no changes, which is actually a result of our mistake. Writing to a separate file and diffing two files will fail if any of the files doesn't exist.