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

How to use line-length in command line for ruff format? #8362

Closed
alanwilter opened this issue Oct 30, 2023 · 1 comment · Fixed by #8363
Closed

How to use line-length in command line for ruff format? #8362

alanwilter opened this issue Oct 30, 2023 · 1 comment · Fixed by #8363

Comments

@alanwilter
Copy link

Plain simple, I want to use ruff format and I don't have any toml configuration.

echo 'aa = [ "blablabla", "blablabla","blablabla","blablabla","blablabla","blablabla","blablabla","blablabla","blablabla","blablabla"]' > test.py
ruff check test.py --select ALL --line-length=120

warning: `one-blank-line-before-class` (D203) and `no-blank-line-before-class` (D211) are incompatible. Ignoring `one-blank-line-before-class`.
warning: `multi-line-summary-first-line` (D212) and `multi-line-summary-second-line` (D213) are incompatible. Ignoring `multi-line-summary-second-line`.
test.py:1:1: D100 Missing docstring in public module
test.py:1:121: E501 Line too long (128 > 120)
Found 2 errors.
(```

But

```bash
ruff format test.py --line-length=120

error: unexpected argument '--line-length' found

  tip: to pass '--line-length' as a value, use '-- --line-length'

Usage: ruff format <FILES|--check|--diff|--config <CONFIG>|--no-cache|--cache-dir <CACHE_DIR>|--respect-gitignore|--no-respect-gitignore|--exclude <FILE_PATTERN>|--force-exclude|--no-force-exclude|--isolated|--stdin-filename <STDIN_FILENAME>|--target-version <TARGET_VERSION>|--preview|--no-preview>

For more information, try '--help'.

If using ruff format test.py it will use the default 88.

@zanieb
Copy link
Member

zanieb commented Oct 30, 2023

Duplicate of #8352

@zanieb zanieb marked this as a duplicate of #8352 Oct 30, 2023
@zanieb zanieb closed this as not planned Won't fix, can't repro, duplicate, stale Oct 30, 2023
zanieb added a commit that referenced this issue Nov 2, 2023
Restores the `--line-length` option removed in
#8131

Closes #8362
Closes #8352
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

Successfully merging a pull request may close this issue.

2 participants