Closed bhirsz closed 2 years ago
Actually I had the same idea some time ago and started working on that but haven't finished with any satisfactory solution. Will come back to it.
It's possible to use Black API directly: https://black.readthedocs.io/en/stable/contributing/reference/reference_functions.html?highlight=format_str#black.format_str
@mnojek Did you perhaps completed it already? I saw blackfiy methods in the code.
Yes, it blackifies the files already here: roboswag/generate/generate.py#L40
Since it's implemented, closing the issue.
Could it be possible to run black from python on generated class? We're trying to match the format using Jinja templates (and it even spread in multi lines if line is too long) but it's still not perfect. We can minimize the effort on our side if we were able to use external formatter (ie the whole
get_python_method_signatur
in endpoint.py could be a lot less complex).