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
The autoformatted is an essential part of many open-rewrite recipes. The general structure of the Python autoformatter will follow that of the Java equivalent. Effectively, these consist of a sequence of visitors, each responsible for specific parts of the formatting process. As the Python code is mapped to an LST that is mostly identical to the Java code, we can reuse much of the same logic already implemented in the Java autoformatting visitors. Below is a list of visitors, each of which should be partially implemented for a workable version of the Python autoformatter and their current status.
Visitors Stage 1 (Complete):
Blank lines
Normalize format
Normalize line breaks
Normalize tabs or spaces
Remove trailing white spaces
Spaces
Tabs and indents
The initial version will not include some more advanced alignment for collections.
Important! To achieve a working Python version as swiftly as possible, we designed it to closely resemble the already (working) Java autoformatter. However, the code/structure in the Java autoformatter has built up a decent amount of technical debt and is a good candidate for refactoring. While this approach is likely the quickest way to construct the Python autoformatter, it also transfers technical debt from the Java visitor to the Python autoformatter. Moreover, some of the logic present in the Java autoformatter might not be required/relevant in the Python autoformatter but is also not harmful; hence, after the autoformatter is in working order and adequate test coverage is established, a secondary refactor/review of the code should be performed.
The text was updated successfully, but these errors were encountered:
What problem are you trying to solve?
The autoformatted is an essential part of many open-rewrite recipes. The general structure of the Python autoformatter will follow that of the Java equivalent. Effectively, these consist of a sequence of visitors, each responsible for specific parts of the formatting process. As the Python code is mapped to an LST that is mostly identical to the Java code, we can reuse much of the same logic already implemented in the Java autoformatting visitors. Below is a list of visitors, each of which should be partially implemented for a workable version of the Python autoformatter and their current status.
Visitors Stage 1 (Complete):
Important! To achieve a working Python version as swiftly as possible, we designed it to closely resemble the already (working) Java autoformatter. However, the code/structure in the Java autoformatter has built up a decent amount of technical debt and is a good candidate for refactoring. While this approach is likely the quickest way to construct the Python autoformatter, it also transfers technical debt from the Java visitor to the Python autoformatter. Moreover, some of the logic present in the Java autoformatter might not be required/relevant in the Python autoformatter but is also not harmful; hence, after the autoformatter is in working order and adequate test coverage is established, a secondary refactor/review of the code should be performed.
The text was updated successfully, but these errors were encountered: