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

fix(ruff): support new ruff fix format #918

Merged
merged 1 commit into from
Apr 18, 2023
Merged

Conversation

fannheyward
Copy link
Owner

support old and new format both

close #916

support old and new format both

close #916
@fannheyward fannheyward merged commit 6035d91 into master Apr 18, 2023
@fannheyward fannheyward deleted the fix/ruff-json-fix branch April 18, 2023 08:09
@lithammer
Copy link
Contributor

Hmm, I don't see fix.message being used anywhere. That's where the title of the fix is.

@fannheyward
Copy link
Owner Author

@lithammer yes, the fix.message didn't use

    "message": "`sys` imported but unused",
    "fix": {
      "message": "Remove unused import: `sys`",

The output.message is used.

@fannheyward
Copy link
Owner Author

fannheyward commented Apr 18, 2023

VSCode + Ruff:

截屏2023-04-18 17 06 47

coc-pyright with ruff:

截屏2023-04-18 17 07 05

Will improve this.

@fannheyward
Copy link
Owner Author

There're two things:

  1. diagnostic message, shows in floating/virtualText, warning the code error, this should use output.message
  2. codeAction message, or codeAction title, this should use msg.message for better human reading

For the first one, if we use output.message:

截屏2023-04-18 17 17 43

This is not good for diagnostic reporting.

@fannheyward
Copy link
Owner Author

截屏2023-04-18 18 14 16

截屏2023-04-18 18 14 28

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 this pull request may close these issues.

2 participants