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

formatter: COM812, ISC001 warning #12085

Closed
Mogost opened this issue Jun 28, 2024 · 2 comments
Closed

formatter: COM812, ISC001 warning #12085

Mogost opened this issue Jun 28, 2024 · 2 comments
Labels
question Asking for support or clarification

Comments

@Mogost
Copy link

Mogost commented Jun 28, 2024

The following configuration triggers a warning message but shouldn't.
All linter rules are enabled but warning contains rules that are in ignore section.

[tool.ruff]
line-length = 120
indent-width = 4

[tool.ruff.format]
quote-style = "double"
indent-style = "space"
skip-magic-trailing-comma = false
line-ending = "auto"
preview = true

[tool.ruff.lint]
select = ["ALL"]
ignore = [
...
    "COM812",  # https://docs.astral.sh/ruff/rules/missing-trailing-comma/
    "ISC001",  # https://docs.astral.sh/ruff/rules/single-line-implicit-string-concatenation/
]
❯ ruff format .
warning: The following rules may cause conflicts when used with the formatter: `COM812`, `ISC001`. To avoid unexpected behavior, we recommend disabling these rules, either by removing them from the `select` or `extend-select` configuration, or adding them to the `ignore` configuration.
2051 files left unchanged
@MichaReiser
Copy link
Member

I tried to reproduce the issue with

[tool.ruff]
preview=true

[tool.ruff.format]
preview = true
quote-style = "double"
indent-style = "space"
skip-magic-trailing-comma = false
line-ending = "auto"

[tool.ruff.lint]
select = ["ALL"]
ignore = [
    "COM812",
    "ISC001",
]

And ran

$ uv tool run ruff format
warning: `uv tool run` is experimental and may change without warning.
Resolved 1 package in 3ms
Installed 1 package in 4ms
 + ruff==0.5.0
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`.
13 files left unchanged

I do get warnings about incompatible linter rules but not about COM812 or ISC001 being incompatible with the formatter. Do you have an other pyproject.tom in a sub folder?

@MichaReiser MichaReiser added the question Asking for support or clarification label Jun 28, 2024
@Mogost
Copy link
Author

Mogost commented Jun 28, 2024

Oops. There is indeed a subdirectory with its own pyproject.toml. As soon as I removed it, the problem went away. Thanks and sorry for the inconvenience.
And thanks for the awesome job!

@Mogost Mogost closed this as completed Jun 28, 2024
Sign up for free to join this conversation on GitHub. Already have an account? Sign in to comment
Labels
question Asking for support or clarification
Projects
None yet
Development

No branches or pull requests

2 participants