Zło To<p>Just rewriting <a href="https://101010.pl/tags/jinja" class="mention hashtag" rel="nofollow noopener noreferrer" target="_blank">#<span>jinja</span></a> python code generator to <a href="https://101010.pl/tags/libCST" class="mention hashtag" rel="nofollow noopener noreferrer" target="_blank">#<span>libCST</span></a> . So far it takes more code to do the same but it's much simpler to do the hard stuff, especially when there's a lot of conditionals.</p><p>Take annotated class field: can be generic or not, can have annotated metadata or not. Annotated metadata may be name (class or function), generic or not, or a call, and so on.</p><p>A big nuisance of libCST is indentation - it belongs to the previous node, even though we tend to think as part of the next one. For an indented language it's rather weird design decision.</p><p><a href="https://101010.pl/tags/JSONSchema" class="mention hashtag" rel="nofollow noopener noreferrer" target="_blank">#<span>JSONSchema</span></a> <a href="https://101010.pl/tags/codeGenerator" class="mention hashtag" rel="nofollow noopener noreferrer" target="_blank">#<span>codeGenerator</span></a> <a href="https://101010.pl/tags/programming" class="mention hashtag" rel="nofollow noopener noreferrer" target="_blank">#<span>programming</span></a> <a href="https://101010.pl/tags/python" class="mention hashtag" rel="nofollow noopener noreferrer" target="_blank">#<span>python</span></a> <a href="https://101010.pl/tags/pythonLapidary" class="mention hashtag" rel="nofollow noopener noreferrer" target="_blank">#<span>pythonLapidary</span></a></p>