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

Maintain minimum number of new lines when formatting methods in a class/service #41523

Conversation

poorna2152
Copy link
Contributor

Purpose

Describe the problems, issues, or needs driving this feature/fix and include links to related issues.

Fixes #41462

Approach

Describe how you are implementing the solutions along with the design details.

Samples

Provide high-level details about the samples related to this feature.

Remarks

List any other known issues, related PRs, TODO items, or any other notes related to the PR.

Check List

  • Read the Contributing Guide
  • Updated Change Log
  • Checked Tooling Support (#)
  • Added necessary tests
    • Unit Tests
    • Spec Conformance Tests
    • Integration Tests
    • Ballerina By Example Tests
  • Increased Test Coverage
  • Added necessary documentation
    • API documentation
    • Module documentation in Module.md files
    • Ballerina By Examples

@codecov
Copy link

codecov bot commented Oct 16, 2023

Codecov Report

All modified and coverable lines are covered by tests ✅

Project coverage is 76.71%. Comparing base (559f3b8) to head (f26132e).
Report is 104 commits behind head on master.

Additional details and impacted files
@@            Coverage Diff            @@
##             master   #41523   +/-   ##
=========================================
  Coverage     76.71%   76.71%           
- Complexity    53085    53101   +16     
=========================================
  Files          2882     2882           
  Lines        200043   200116   +73     
  Branches      26050    26063   +13     
=========================================
+ Hits         153455   153517   +62     
- Misses        38138    38144    +6     
- Partials       8450     8455    +5     

☔ View full report in Codecov by Sentry.
📢 Have feedback on the report? Share it here.

Copy link
Contributor

@NipunaRanasinghe NipunaRanasinghe left a comment

Choose a reason for hiding this comment

The reason will be displayed to describe this comment to others. Learn more.

It seems these minimum/maximum line numbers are not configurable via FormattingOptions. Is that expected? Are there any plans to support that in the future?

@poorna2152
Copy link
Contributor Author

It seems these minimum/maximum line numbers are not configurable via FormattingOptions. Is that expected? Are there any plans to support that in the future?

We can add a formatting option here to configure the minimum number newline after method definitions. This also be added in the formatting configuration feature. WDYT

Copy link

github-actions bot commented Nov 9, 2023

This PR has been open for more than 15 days with no activity. This will be closed in 3 days unless the stale label is removed or commented.

@github-actions github-actions bot added the Stale label Nov 9, 2023
@poorna2152 poorna2152 removed the Stale label Nov 9, 2023
Copy link

This PR has been open for more than 15 days with no activity. This will be closed in 3 days unless the stale label is removed or commented.

@github-actions github-actions bot added the Stale label Nov 25, 2023
@nipunayf nipunayf removed the Stale label Nov 26, 2023
@poorna2152 poorna2152 added Team/CompilerFE All issues related to Language implementation and Compiler, this exclude run times. Area/Formatting labels Nov 27, 2023
Copy link

This PR has been open for more than 15 days with no activity. This will be closed in 3 days unless the stale label is removed or commented.

Copy link

This PR has been open for more than 15 days with no activity. This will be closed in 3 days unless the stale label is removed or commented.

Copy link

This PR has been open for more than 15 days with no activity. This will be closed in 3 days unless the stale label is removed or commented.

Copy link

github-actions bot commented Feb 2, 2024

This PR has been open for more than 15 days with no activity. This will be closed in 3 days unless the stale label is removed or commented.

@github-actions github-actions bot added the Stale label Feb 2, 2024
@poorna2152 poorna2152 removed the Stale label Feb 3, 2024
Copy link

This PR has been open for more than 15 days with no activity. This will be closed in 3 days unless the stale label is removed or commented.

dulajdilshan
dulajdilshan previously approved these changes Mar 1, 2024
@poorna2152 poorna2152 force-pushed the class_method_formatting branch 2 times, most recently from a059057 to bd1416a Compare March 5, 2024 08:41
@poorna2152 poorna2152 force-pushed the class_method_formatting branch from bd1416a to ada86d6 Compare March 5, 2024 08:48
@poorna2152 poorna2152 force-pushed the class_method_formatting branch from 1f5e6ee to f26132e Compare March 5, 2024 10:04
@poorna2152 poorna2152 changed the base branch from master to poorna_formatter March 6, 2024 04:55
@lochana-chathura lochana-chathura merged commit a998644 into ballerina-platform:poorna_formatter Mar 6, 2024
17 of 18 checks passed
@poorna2152
Copy link
Contributor Author

Merged to a feature branch due to tests failing in the openapi and graphql-cli.

@poorna2152
Copy link
Contributor Author

Sending to master in #42370

Sign up for free to join this conversation on GitHub. Already have an account? Sign in to comment
Labels
Area/Formatting Team/CompilerFE All issues related to Language implementation and Compiler, this exclude run times.
Projects
None yet
Development

Successfully merging this pull request may close these issues.

[Improvement]: Preserve a minimum number of blank lines when formatting module-level defintions
7 participants