8000 T201/T203 Improve print/pprint docs by dragon-dxw · Pull Request #18130 · astral-sh/ruff · GitHub
[go: up one dir, main page]
More Web Proxy on the site http://driver.im/
Skip to content

T201/T203 Improve print/pprint docs #18130

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

Merged
merged 3 commits into from
May 18, 2025
Merged

Conversation

dragon-dxw
Copy link
Contributor
  • discuss legitimate uses like CLI
  • discuss how to log

Summary

These rules are great when referring to adhoc debug print statements, but it's worth flagging up that there are absolutely fine legitimate uses of print() and pprint() and that the rule applies to debugging more or less exclusively.

It's not easy to come up with a simple, minimal example of what using logging looks like; I'm not convinced this one is great.

I'm not sure this is quite right, but I think there's a kernel of something better than what we've got, which is important because this appears to becoming the defacto reference for "why print in production code is bad"

Test Plan

It hasn't been. But I did check the python code fragments didn't error on ruff.

* discuss legitimate uses like CLI
* discuss how to log
@ntBre ntBre added the documentation Improvements or additions to documentation label May 16, 2025
Copy link
Contributor
github-actions bot commented May 16, 2025

ruff-ecosystem results

Linter (stable)

✅ ecosystem check detected no linter changes.

Linter (preview)

✅ ecosystem check detected no linter changes.

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. This is great

@MichaReiser MichaReiser merged commit 660375d into astral-sh:main May 18, 2025
34 checks passed
Sign up for free to join this conversation on GitHub. Already have an account? Sign in to comment
Labels
documentation Improvements or additions to documentation
Projects
None yet
Development

Successfully merging this pull request may close these issues.

3 participants
0