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

Wrap comments when they excede a certain line length #52

Closed
Dekkonot opened this issue Feb 11, 2021 · 3 comments
Closed

Wrap comments when they excede a certain line length #52

Dekkonot opened this issue Feb 11, 2021 · 3 comments

Comments

@Dekkonot
Copy link

Comments should ideally be wrapped at a certain line length to maintain readability. Roblox's style guide suggests 80, which is what I use, but I've also seen people use 120 or any random number.

This should ideally apply only to comments that on on lines by themselves (blah() --todo foobar shouldn't be formatted) and wrap at word boundaries (which can be accomplished with a basic regex pattern). To avoid styling the comment or ruining LDoc, it should maintain any trivia at the beginning of the comment (e.g. preserve --- and -- ).

@JohnnyMorganz
Copy link
Owner

Comments are a tricky one here, as they can contain absolutely anything.

People can create diagrams, pieces of text, commented out code, or whatever they want, using both single line or multi line comments.

Formatting comments (which I was initially doing pre-release) is invasive, as it may lead to unwanted changes. We don't know what the comment is about.

I'm not sure this is something we can implement

@LastTalon
Copy link
Contributor

LastTalon commented Feb 13, 2021

This is possibly a good candidate for a separate tool. Formatting comments I think is a completely separate task for the reasons already stated. Those who wanted could use both StyLua and the new tool for this desired effect.

@JohnnyMorganz
Copy link
Owner

I am closing this as I do not believe I will be formatting comments anytime soon.

I think the only thing that I would likely format would he LuaDoc/LDoc comments, as they have a specific structure. It's unlikely that will happen anytime soon as I have no use case for it, but if you do, feel free to open up an issue about it.

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

3 participants