You signed in with another tab or window. Reload to refresh your session.You signed out in another tab or window. Reload to refresh your session.You switched accounts on another tab or window. Reload to refresh your session.Dismiss alert
I understand this is not a critical issue since the default version of jmustache works fine. However, I spent a day troubleshooting this so decided to share my findings to help others avoid similar struggles.
I attempted to build a Python client using a Gradle plugin but ended up with broken code that looks like this:
Further investigation revealed the problem originates from the new version of jmustache. This library had not been updated since 2019, but in November 2023, the author released version 1.16, which is pulled in by another Gradle plugin I use. As far as I can understand, the issue arises from a change in how the new version processes templates that included with {{>. Version 1.15 appends a newline (\n) at the end of a file if it's missing, while version 1.16 does not (which might actually be more correct behavior).
Specifically, the inner template partial_api.mustache lacks a newline at the end. As a result, jmustache generates Python code with broken indentation.
Interestingly, this issue is a regression introduced after this commit. Before this commit, the code generation was correct since partial_api.mustache did not exist yet.
The text was updated successfully, but these errors were encountered:
I understand this is not a critical issue since the default version of jmustache works fine. However, I spent a day troubleshooting this so decided to share my findings to help others avoid similar struggles.
I attempted to build a Python client using a Gradle plugin but ended up with broken code that looks like this:
Further investigation revealed the problem originates from the new version of jmustache. This library had not been updated since 2019, but in November 2023, the author released version 1.16, which is pulled in by another Gradle plugin I use. As far as I can understand, the issue arises from a change in how the new version processes templates that included with {{>. Version 1.15 appends a newline (\n) at the end of a file if it's missing, while version 1.16 does not (which might actually be more correct behavior).
Specifically, the inner template partial_api.mustache lacks a newline at the end. As a result, jmustache generates Python code with broken indentation.
Interestingly, this issue is a regression introduced after this commit. Before this commit, the code generation was correct since partial_api.mustache did not exist yet.
The text was updated successfully, but these errors were encountered: