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

Split comments if they exceed the line limit #723

Closed
ahoppen opened this issue Apr 24, 2024 · 2 comments
Closed

Split comments if they exceed the line limit #723

ahoppen opened this issue Apr 24, 2024 · 2 comments

Comments

@ahoppen
Copy link
Member

ahoppen commented Apr 24, 2024

Formatting the following leaves the line comment as a single line even though it exceeds the line limit. We should break it up into multiple lines.

// some very long comment that just goes on and on and one without providing any real value but it reaches past the end of the line limit

Other interesting cases to consider are

End of line comments

I’m honestly not sure how to break this best, would make sense to check what eg. clang-format does

print("Hello, world!")  // some very long comment that just goes on and on and one without providing any real value but it reaches past the line limit

Indented comment parts

Here we should probably wrap the comment at the same indentation level that the line already has (ie. the wrapped line should also have 3 spaces after //)

// - some very long comment in a markdown list 
//   that just goes on and on and one without providing any real value but it reaches past line limit

Here, the wrapped line should also be aligned with some, not entirely sure what the general rule should be.

// - some very long comment in a markdown list that just goes on and on and one without providing any real value but it reaches past the line limit
@ahoppen
Copy link
Member Author

ahoppen commented Apr 24, 2024

Synced to Apple’s issue tracker as rdar://126967198

@allevato
Copy link
Member

Duplicate of #469?

@ahoppen ahoppen closed this as completed Apr 24, 2024
Sign up for free to join this conversation on GitHub. Already have an account? Sign in to comment
Labels
None yet
Projects
None yet
Development

No branches or pull requests

2 participants