-
Notifications
You must be signed in to change notification settings - Fork 1.1k
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
Unify line size settings between ruff and the formatter #6873
Merged
Conversation
This file contains 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
This was referenced Aug 25, 2023
Current dependencies on/for this PR:
This comment was auto-generated by Graphite. |
This comment was marked as outdated.
This comment was marked as outdated.
konstin
force-pushed
the
ruff-format-a-project
branch
from
August 25, 2023 14:15
8a816d7
to
e66ea4f
Compare
konstin
force-pushed
the
merge-line-sizings
branch
from
August 25, 2023 14:15
3914e5e
to
ff4a5e4
Compare
konstin
force-pushed
the
ruff-format-a-project
branch
from
August 25, 2023 14:28
e66ea4f
to
cb8a038
Compare
konstin
force-pushed
the
merge-line-sizings
branch
3 times, most recently
from
August 25, 2023 15:14
b2235f9
to
bb6991b
Compare
konstin
commented
Aug 25, 2023
scripts/add_rule.py
Outdated
@@ -140,7 +140,8 @@ def main(*, name: str, prefix: str, code: str, linter: str) -> None: | |||
variant = pascal_case(linter) | |||
rule = f"""rules::{linter.split(" ")[0]}::rules::{name}""" | |||
lines.append( | |||
" " * 8 |
There was a problem hiding this comment.
Choose a reason for hiding this comment
The reason will be displayed to describe this comment to others. Learn more.
that's the deviation from black we're introducing, i'm using it to confirm that it actually formats
MichaReiser
reviewed
Aug 25, 2023
konstin
force-pushed
the
ruff-format-a-project
branch
from
August 25, 2023 16:19
613f043
to
60af5ae
Compare
konstin
force-pushed
the
merge-line-sizings
branch
from
August 25, 2023 16:20
2547043
to
f8b36a6
Compare
konstin
force-pushed
the
ruff-format-a-project
branch
from
August 25, 2023 16:28
60af5ae
to
55c38e5
Compare
konstin
force-pushed
the
merge-line-sizings
branch
from
August 25, 2023 16:28
f8b36a6
to
499e311
Compare
MichaReiser
force-pushed
the
merge-line-sizings
branch
from
August 26, 2023 15:48
499e311
to
7c2675e
Compare
MichaReiser
reviewed
Aug 26, 2023
MichaReiser
force-pushed
the
merge-line-sizings
branch
from
August 26, 2023 15:57
bd7933d
to
a4583e8
Compare
MichaReiser
force-pushed
the
merge-line-sizings
branch
from
August 27, 2023 09:01
a4583e8
to
fdd131b
Compare
MichaReiser
force-pushed
the
merge-line-sizings
branch
from
August 28, 2023 06:01
fdd131b
to
13c32a7
Compare
**Summary** Previuosly, there had been `LineLength` in ruff and `LineWidth` in the formatter. `LineLength` was a lenient usize wrapper, while `LineWidth` was a strict u16. With the formatter moving into the ruff cli, we need to unify the two types. This PR makes both crates share a new `LineLength` type based on the previous ruff formatter type. It currently lives in `ruff_python_trivia` but i'm happy to move it wherever. This is technically a breaking change because the line limit afterwards has a limit of 320 that it didn't have before. **Test Plan** No functional changes.
MichaReiser
force-pushed
the
merge-line-sizings
branch
from
August 28, 2023 06:26
13c32a7
to
f0610e9
Compare
MichaReiser
changed the title
Unify line size settings between ruff and the formatter
Unify line size settings between ruff and the formatter
Aug 28, 2023
This was referenced Sep 15, 2023
zanieb
added a commit
that referenced
this pull request
Sep 15, 2023
<!-- Thank you for contributing to Ruff! To help us out with reviewing, please consider the following: - Does this pull request include a summary of the change? (See below.) - Does this pull request include a descriptive title? - Does this pull request include references to any relevant issues? --> ## Summary <!-- What's the purpose of the change? What does it do, and why? --> Adds the maximum of 320 for the line-length setting to the JSON schema for better integration with IDEs. Related #6873 ## Test Plan <!-- How was it tested? -->
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 Previuosly, there had been
LineLength
in ruff andLineWidth
in the formatter.LineLength
was a lenient usize wrapper, whileLineWidth
was a strict u16. With the formatter moving into the ruff cli, we need to unify the two types. This PR makes both crates share a newLineLength
type based on the previous ruff formatter type. It currently lives inruff_python_trivia
but i'm happy to move it wherever.This is technically a breaking change because the line limit afterwards has a limit of 320 that it didn't have before.
Test Plan No functional changes.