Add formatter to line-length documentation#8150
Merged
MichaReiser merged 1 commit intomainfrom Oct 24, 2023
Merged
Conversation
Member
Author
|
Current dependencies on/for this PR:
This comment was auto-generated by Graphite. |
29142df to
1c1aed4
Compare
MichaReiser
commented
Oct 24, 2023
| ```toml | ||
| [tool.ruff] | ||
| # Set the maximum line length to 79 characters. | ||
| # Set the maximum line length to 79. |
Member
Author
There was a problem hiding this comment.
I'm undecided if we should remove characters from here. I don't think mentioning it is necessary, most will assume characters anyway.
Contributor
charliermarsh
approved these changes
Oct 24, 2023
1c1aed4 to
de85ade
Compare
konstin
approved these changes
Oct 24, 2023
Comment on lines
+357
to
+358
| /// The length is determined by the number of characters per line, except for lines containing East Asian characters or emojis. | ||
| /// For these lines, the [unicode width](https://unicode.org/reports/tr11/) of each character is added up to determine the length. |
Member
There was a problem hiding this comment.
Suggested change
| /// The length is determined by the number of characters per line, except for lines containing East Asian characters or emojis. | |
| /// For these lines, the [unicode width](https://unicode.org/reports/tr11/) of each character is added up to determine the length. | |
| /// The length is determined by the [unicode width](https://unicode.org/reports/tr11/). For ASCII text, | |
| /// this is number of characters, but for others such as East Asian characters or emoji, the width varies. | |
| /// Note that the unicode width does not necessarily line up with columns in your editor. |
| ```toml | ||
| [tool.ruff] | ||
| # Set the maximum line length to 79 characters. | ||
| # Set the maximum line length to 79. |
levrik
reviewed
Oct 25, 2023
| /// documentation (`W505`), including standalone comments. By default, | ||
| /// this is set to null which disables reporting violations. | ||
| /// | ||
| /// The length is determined by the number of characters per line, except for lines containinAsian characters or emojis. |
This file contains hidden or bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
Sign up for free
to join this conversation on GitHub.
Already have an account?
Sign in to comment
Add this suggestion to a batch that can be applied as a single commit.This suggestion is invalid because no changes were made to the code.Suggestions cannot be applied while the pull request is closed.Suggestions cannot be applied while viewing a subset of changes.Only one suggestion per line can be applied in a batch.Add this suggestion to a batch that can be applied as a single commit.Applying suggestions on deleted lines is not supported.You must change the existing code in this line in order to create a valid suggestion.Outdated suggestions cannot be applied.This suggestion has been applied or marked resolved.Suggestions cannot be applied from pending reviews.Suggestions cannot be applied on multi-line comments.Suggestions cannot be applied while the pull request is queued to merge.Suggestion cannot be applied right now. Please check back later.

Summary
This PR updates the
line-lengthoption documentation to mention its usage in the formatter.I used this as an opportunity to clarify how the line-length is measured (using unicode width rather than characters) and removed the
(characters)unit from theline-too-longanddoc-line-too-longlints.Closes #7574
Closes #7573
Note: I decided not to rename the options to
-width, at least for now. Mainly because performing the renaming causes other inconsistencies:line-too-longwould need to be renamed toline-too-wide. Same fordoc-line-too-longignore-overlong-task-commentsoption would need to be renamed toignore-overwide-task-comments.While I like
widthmore, it seemed out of scope to rush these changes before the formatter release (and change it as part of a patch release).Test Plan
I generated and reviewed the build documentation.