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

Add CI task to automatically format docstring comment line lengths #1594

Open
alice-i-cecile opened this issue Mar 8, 2021 · 4 comments
Open
Labels
A-Build-System Related to build systems or continuous integration C-Code-Quality A section of code that is hard to understand or change C-Docs An addition or correction to our documentation S-Blocked This cannot move forward until something else changes

Comments

@alice-i-cecile
Copy link
Member

What problem does this solve or what need does it fill?

Keeping lines to a fixed width makes them easier to read, and avoids noisy commits as this is periodically fixed.

What solution would you like?

Add a task to the CI that automatically formats docstring line length to 100 characters, like the code.

What alternative(s) have you considered?

It may also be possible to do this on the user side with cargo fmt configuration options?

Additional context

This was mentioned to me by @Ratysz when working on #1578, and will likely come up repeatedly as new contributors add to docs.

@alice-i-cecile
Copy link
Member Author

This could also check for /// over /* */ patterns, to keep a consistent style.

@alice-i-cecile alice-i-cecile added A-Build-System Related to build systems or continuous integration C-Code-Quality A section of code that is hard to understand or change C-Docs An addition or correction to our documentation labels Mar 8, 2021
@mockersf
Copy link
Member

mockersf commented Mar 8, 2021

Add a task to the CI that automatically formats docstring line length to 100 characters, like the code.

CI should check but not format.

Having CI add commit to a PR is a great way to have conflicts. They may be not hard to resolve, but that's still painful. Also, I think it's better to share good practices by CI failures, then explanation, rather than just CI fixing things

@cart
Copy link
Member

cart commented Mar 14, 2021

We've added the config in #1603, but it isn't enabled in CI (because it is a nightly feature). Lets leave this open until it stabilizes (or we move back to nightly rustfmt)

@cart cart reopened this Mar 14, 2021
@mockersf
Copy link
Member

blocked on rust-lang/rustfmt#3347

@mockersf mockersf added the S-Blocked This cannot move forward until something else changes label Jan 18, 2023
Sign up for free to join this conversation on GitHub. Already have an account? Sign in to comment
Labels
A-Build-System Related to build systems or continuous integration C-Code-Quality A section of code that is hard to understand or change C-Docs An addition or correction to our documentation S-Blocked This cannot move forward until something else changes
Projects
None yet
Development

Successfully merging a pull request may close this issue.

3 participants