-
Notifications
You must be signed in to change notification settings - Fork 118
New issue
Have a question about this project? Sign up for a free GitHub account to open an issue and contact its maintainers and the community.
By clicking “Sign up for GitHub”, you agree to our terms of service and privacy statement. We’ll occasionally send you account related emails.
Already on GitHub? Sign in to your account
[Enhancement][Track] Formatting tools with KCL Code style specifications #627
Comments
Hi @Peefy, could you please describe this requirement more detailed? I didn't get it precisely 😶🌫️
|
@Peefy I‘ve added some test cases to clarify the expected formatting behaviors on the issues raised above. ptal and verify the golden files. #786 And here are some ambiguities:
This statement is kind of ambiguous -- I believe this sentence is not referring to preserving all user-written blank lines (for example, typically only one blank line should be kept between statements, and there shouldn't be any blank lines between entries in list/dict/schema expressions).
Is this statement corresponding to the rule "Break one blank line between different statements e.g., import, schema and expression statements."? If so, I think this is exactly the same as another case to fix that you provide: "Leave additional line spacing between schema definitions and imports" It would be helpful if you could provide some code examples (or you can directly add some |
cc @NeverRaR , @Peefy , @i-zhen Here are some cases that the formatting behavior depends on the CST(which records the original token infos such as parenthesis, comments, whitespace and line breaks):
(the code samples could be found in this issue's initial content) and the tracking issue of the context of the (Lossless/Describing/Concrete) Syntax Tree |
Related Impl: https://github.com/kcl-lang/tree-sitter-kcl |
Enhancement
Spec: https://kcl-lang.io/docs/reference/lang/spec/codestyle
"Alice" | "Bob"
instead of"Alice"|"Bob"
: fixed in fix: format behavior of union types #790Before format
After format
code spec need to be updated, tacked in [Spec] the code style spec should clarify the recommonded order of index signature and attributes kcl-lang.io#183
to be discussed:
The text was updated successfully, but these errors were encountered: