Skip to content
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

fix: formatting support for multiple if statements #1041

Merged
merged 3 commits into from
Feb 17, 2024

Conversation

shashank-iitbhu
Copy link
Contributor

@shashank-iitbhu shashank-iitbhu commented Feb 15, 2024

1. Does this PR affect any open issues?(Y/N) and add issue references:

  • N
  • Y

fixes #1039

2. What is the scope of this PR (e.g. component or file name):

kclvm/ast_pretty/src/node.rs

3. Provide a description of the PR(e.g. more details, effects, motivations or doc link):

Screen.Recording.2024-02-16.at.3.34.02.AM.mov
  • Since if_stmt.orelse is Vec<NodeRef<Stmt>>, so to format the code correctly for multiple if statements inside an else block, had to iterate through all the elements of if_stmt.orelse.
  • This approach ensures that all the if statements are formatted correctly.

4. Are there any breaking changes?(Y/N) and describe the breaking changes(e.g. more details, motivations or doc link):

  • N
  • Y

5. Are there test cases for these changes?(Y/N) select and add more details, references or doc links:

  • Unit test
  • Integration test
  • Benchmark (add benchmark stats below)
  • Manual test (add detailed scripts or steps below)
  • Other

Signed-off-by: Shashank Mittal <shashank.mittal.mec22@itbhu.ac.in>
Copy link

github-actions bot commented Feb 15, 2024

CLA Assistant Lite bot All contributors have signed the CLA ✍️ ✅

@shashank-iitbhu
Copy link
Contributor Author

I have read the CLA Document and I hereby sign the CLA

@shashank-iitbhu
Copy link
Contributor Author

recheck

Peefy added a commit to kcl-lang/cla.db that referenced this pull request Feb 15, 2024
@coveralls
Copy link
Collaborator

coveralls commented Feb 15, 2024

Pull Request Test Coverage Report for Build 7934340233

Details

  • 0 of 15 (100.0%) changed or added relevant lines in 1 file are covered.
  • 241 unchanged lines in 8 files lost coverage.
  • Overall coverage decreased (-15.4%) to 72.337%

Files with Coverage Reduction New Missed Lines %
compiler_base/error/src/diagnostic/diagnostic_message.rs 3 0.0%
compiler_base/error/src/diagnostic/components.rs 6 0.0%
compiler_base/error/src/errors.rs 8 0.0%
compiler_base/error/src/diagnostic/diagnostic_handler.rs 11 0.0%
compiler_base/session/src/lib.rs 26 58.06%
compiler_base/error/src/diagnostic/mod.rs 27 0.0%
compiler_base/error/src/diagnostic/style.rs 41 0.0%
compiler_base/error/src/emitter.rs 119 0.0%
Totals Coverage Status
Change from base Build 7798962109: -15.4%
Covered Lines: 43878
Relevant Lines: 60658

💛 - Coveralls

Signed-off-by: Shashank Mittal <shashank.mittal.mec22@itbhu.ac.in>
@shashank-iitbhu
Copy link
Contributor Author

@Peefy Any idea why these workflows are failing? went through the logs, I think these workflows need to be updated.

Signed-off-by: Shashank Mittal <shashank.mittal.mec22@itbhu.ac.in>
@Peefy Peefy merged commit a735a37 into kcl-lang:main Feb 17, 2024
11 of 13 checks passed
@github-actions github-actions bot locked and limited conversation to collaborators Feb 17, 2024
Sign up for free to subscribe to this conversation on GitHub. Already have an account? Sign in.
Labels
None yet
Projects
None yet
Development

Successfully merging this pull request may close these issues.

kcl fmt command removes legit code when formatting
3 participants