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

ruff format does not break overlong lines #12188

Closed
PerMildner opened this issue Jul 4, 2024 · 3 comments
Closed

ruff format does not break overlong lines #12188

PerMildner opened this issue Jul 4, 2024 · 3 comments

Comments

@PerMildner
Copy link

I would expect ruff format to break overlong comment lines, but it does not seem to do this.

The example is from a devcontainer terminal within VSCode, but I do not think that is significant, given that I pass the --isolated flag to ruff.

Note that ruff format does fix the repeated whitespace (so format does some work) but it does nothing with the long comment line.

$ poetry run ruff --version
ruff 0.5.0
$ poetry run ruff format --verbose --isolated --line-length=88 --diff tests/conftest.py 
[2024-07-04][12:47:40][ruff::resolve][DEBUG] Isolated mode, not reading any pyproject.toml
[2024-07-04][12:47:40][ruff::commands::format][DEBUG] format_path; path=/home/user/..redacted../tests/conftest.py
[2024-07-04][12:47:40][tracing::span][DEBUG] Printer::print;
[2024-07-04][12:47:40][ruff::commands::format][DEBUG] Formatted 1 files in 20.02ms
--- tests/conftest.py
+++ tests/conftest.py
@@ -20,7 +20,7 @@
 # Test whether CI detect this overlong line: long long long long long long long long long long long long long long long long long long long long long long long long long long long long long long long long long long long long long long long long long long long long long long long long
 @pytest.fixture(scope="session")
 def s3(request: pytest.FixtureRequest) -> S3Client:
-    url =    request.config.option.storage_url
+    url = request.config.option.storage_url
     if url is None:
         pytest.fail("No --storage-url parameter passed to pytest", False)
     user = request.config.option.storage_user

1 file would be reformatted
$
@MichaReiser
Copy link
Member

It took me a moment to find the issue. I knew it was somewhere. I'll close this issue in favor of #7414

@MichaReiser MichaReiser closed this as not planned Won't fix, can't repro, duplicate, stale Jul 4, 2024
@charliermarsh
Copy link
Member

Yeah, we don't wrap overlong comments.

@PerMildner
Copy link
Author

PerMildner commented Jul 4, 2024

Thanks for the update. I understand.

That this is, at least for now, as intended is not at all clear from the documentation of ruff format, though.

Should I open a separate "documentation is unclear" ticket?

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