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

C414 removes comment #7772

Closed
JelleZijlstra opened this issue Oct 3, 2023 · 3 comments · Fixed by #7775
Closed

C414 removes comment #7772

JelleZijlstra opened this issue Oct 3, 2023 · 3 comments · Fixed by #7775
Assignees
Labels
bug Something isn't working

Comments

@JelleZijlstra
Copy link
Contributor

$ cat xxx.py 
xxxxxxxxxxx_xxxxx_xxxxx = sorted(
    list(x_xxxx_xxxxxxxxxxx_xxxxx.xxxx()),
    # xxxxxxxxxxx xxxxx xxxx xxx xx Nxxx, xxx xxxxxx3 xxxxxxxxx xx
    # xx xxxx xxxxxxx xxxx xxx xxxxxxxx Nxxx
    key=lambda xxxxx: xxxxx or "",
)
$ python -m ruff --version
ruff 0.0.292
$ python -m ruff check --isolated --select=C414 --fix --diff xxx.py 
--- xxx.py
+++ xxx.py
@@ -1,6 +1,3 @@
 xxxxxxxxxxx_xxxxx_xxxxx = sorted(
-    list(x_xxxx_xxxxxxxxxxx_xxxxx.xxxx()),
-    # xxxxxxxxxxx xxxxx xxxx xxx xx Nxxx, xxx xxxxxx3 xxxxxxxxx xx
-    # xx xxxx xxxxxxx xxxx xxx xxxxxxxx Nxxx
-    key=lambda xxxxx: xxxxx or "",
+    x_xxxx_xxxxxxxxxxx_xxxxx.xxxx(), key=lambda xxxxx: xxxxx or "",
 )

Would fix 1 error.
@charliermarsh charliermarsh added the bug Something isn't working label Oct 3, 2023
@charliermarsh
Copy link
Member

charliermarsh commented Oct 3, 2023

Thanks. We handle these fixes manually with LibCST. We should be able to preserve the comments.

@JelleZijlstra
Copy link
Contributor Author

Thanks for the quick fixes on both of my issues!

@charliermarsh
Copy link
Member

Thanks for filing, appreciate it!

Sign up for free to join this conversation on GitHub. Already have an account? Sign in to comment
Labels
bug Something isn't working
Projects
None yet
Development

Successfully merging a pull request may close this issue.

2 participants