Automatically Wrap Long Line Comments #14812
-
Hello, |
Beta Was this translation helpful? Give feedback.
Answered by
MichaReiser
Dec 9, 2024
Replies: 2 comments 5 replies
-
Is W505 what you're looking for? You can enable it with |
Beta Was this translation helpful? Give feedback.
0 replies
-
I modified my pyproject.toml with W505 and max-doc-lenght but without success [tool.ruff]
line-length = 120
extend-include = [
"*.ipynb",
"*.qmd"]
[tool.ruff.format]
preview = true
quote-style = "double"
[tool.ruff.lint]
select = ["ALL"]
ignore = [
"ANN", # Mypy is better at this
"COM", # Formatter takes care of our commas
"E501", # leave line-length enforcement to formatter
"T201", # I am using print
"D100",
"D101",
"D102",
"D103",
"D104", # D100-104 missing docstring
"D107", # undocumented-public-init
"INP001", # missing __init__ in external library
]
# Add the `line-too-long` rule to the enforced rule set.
extend-select = ["W505"]
[tool.ruff.lint.isort]
lines-between-types = 1
lines-after-imports = 2
[tool.ruff.lint.pydocstyle]
convention = "google"
max-doc-length = 120 Also when I run Cause: TOML parse error at line 47, column 1
|
47 | [tool.ruff.lint]
| ^^^^^^^^^^^^^^^^
unknown field `max-line-length`, expected one of `convention`, `ignore-decorators`, `property-decorators` |
Beta Was this translation helpful? Give feedback.
5 replies
Sign up for free
to join this conversation on GitHub.
Already have an account?
Sign in to comment
There's no automatic formatting for overlong comments. The rule only detects them.
You need to install the ruff vscode extension. It should then automatically pick up your configuration. You may have to restart vs code