Skip to content

Conversation

@CodeMan62
Copy link
Contributor

Summary

So this PR fixes #18199 in the issue mentioned the error message is as followed

$ ruff format --check .build/mytool.py
warning: The following rule may cause conflicts when used with the formatter: `COM812`. To avoid unexpected behavior, we recommend disabling this rule, either by removing it from the `select` or `extend-select` configuration, or adding it to the `ignore` configuration.

the new message contains full option name as guided in issue the new message looks like this

$ ruff format --check .build/mytool.py
warning: The following rule may cause conflicts when used with the formatter: `COM812`. To avoid unexpected behavior, we recommend disabling this rule, either by removing it from the `select` or `extend-select` configuration, or adding it to the `lint.ignore` configuration.

Test Plan

I just did manual testing

@CodeMan62
Copy link
Contributor Author

CodeMan62 commented May 20, 2025

This time tests must pass because last time I have give wrong path but this time this is right and good to go
I was wrong I am refactoring

@CodeMan62 CodeMan62 marked this pull request as draft May 20, 2025 13:30
----- stderr -----
warning: The following rule may cause conflicts when used with the formatter: `COM812`. To avoid unexpected behavior, we recommend disabling this rule, either by removing it from the `select` or `extend-select` configuration, or adding it to the `ignore` configuration.
warning: The following rule may cause conflicts when used with the formatter: `COM812`. To avoid unexpected behavior, we recommend disabling this rule, either by removing it from the `select` or `extend-select` configuration, or adding it to the `ruff.ignore` configuration.
Copy link
Member

Choose a reason for hiding this comment

The reason will be displayed to describe this comment to others. Learn more.

What you change here is the test. You need to change the implementation here

warn_user_once!("The following rule may cause conflicts when used with the formatter: {rule}. To avoid unexpected behavior, we recommend disabling this rule, either by removing it from the `select` or `extend-select` configuration, or adding it to the `ignore` configuration.");
(and other lines)

Copy link
Contributor Author

@CodeMan62 CodeMan62 May 20, 2025

Choose a reason for hiding this comment

The reason will be displayed to describe this comment to others. Learn more.

thanks i was just finding it.
EDIT:- Done

@CodeMan62 CodeMan62 marked this pull request as ready for review May 20, 2025 14:02
Copy link
Member

@MichaReiser MichaReiser left a comment

Choose a reason for hiding this comment

The reason will be displayed to describe this comment to others. Learn more.

Thanks, I've a small suggestion but this otherwise looks good.

if let [rule] = rule_names.as_slice() {
warn_user_once!(
"The following rule may cause conflicts when used with the formatter: {rule}. To avoid unexpected behavior, we recommend disabling this rule, either by removing it from the `select` or `extend-select` configuration, or adding it to the `ignore` configuration."
"The following rule may cause conflicts when used with the formatter: {rule}. To avoid unexpected behavior, we recommend disabling this rule, either by removing it from the `select` or `extend-select` configuration, or adding it to the `lint.ignore` configuration."
Copy link
Member

Choose a reason for hiding this comment

The reason will be displayed to describe this comment to others. Learn more.

Let's use the full qualified name for all settings (same below)

Suggested change
"The following rule may cause conflicts when used with the formatter: {rule}. To avoid unexpected behavior, we recommend disabling this rule, either by removing it from the `select` or `extend-select` configuration, or adding it to the `lint.ignore` configuration."
"The following rule may cause conflicts when used with the formatter: {rule}. To avoid unexpected behavior, we recommend disabling this rule, either by removing it from the `lint.select` or `lint.extend-select` configuration, or adding it to the `lint.ignore` configuration."

Copy link
Contributor Author

@CodeMan62 CodeMan62 May 20, 2025

Choose a reason for hiding this comment

The reason will be displayed to describe this comment to others. Learn more.

Okk
EDIT:- DONE

@dhruvmanila dhruvmanila added the cli Related to the command-line interface label May 20, 2025
@github-actions
Copy link
Contributor

ruff-ecosystem results

Linter (stable)

✅ ecosystem check detected no linter changes.

Linter (preview)

✅ ecosystem check detected no linter changes.

@MichaReiser
Copy link
Member

Thanks

@MichaReiser MichaReiser merged commit 90ca0a4 into astral-sh:main May 20, 2025
34 checks passed
Sign up for free to join this conversation on GitHub. Already have an account? Sign in to comment

Labels

cli Related to the command-line interface

Projects

None yet

Development

Successfully merging this pull request may close these issues.

ruff format does not support ignore despite explicit instructions to do so

3 participants