Skip to content

using ruff to modify python source code #12500

Answered by MichaReiser
ChannyClaus asked this question in Q&A
Discussion options

You must be logged in to vote

I don't think you want to use the formatter for this. The formatter is a pretty printer. It formats the code according to Black's style guide.

What I would use is:

  • Transformer: To transform the AST (remove the arguments)
  • Generator: To print the transformed AST back to a string

Replies: 1 comment 2 replies

Comment options

You must be logged in to vote
2 replies
@ChannyClaus
Comment options

@MichaReiser
Comment options

Answer selected by ChannyClaus
Sign up for free to join this conversation on GitHub. Already have an account? Sign in to comment
Category
Q&A
Labels
None yet
2 participants