Where is code format for python?

Question:
Where is code re-formatting for python? Or, what happened to code formatting in python?

By re-formatting I mean fixing up the spacing between functions, for instance. Convention is two lines before a function definition.

I am 95% sure that replit offered the ability to reformat code using the contextual (right-click) menu. No matter where I look it seems to have disappeared (or, maybe replit never offered this?). All I see now is some useless AI button and an indent formatting button.

FYI I created a new Python repl from scratch to test the behavior in case it was a corruption of an existing repl.

Replit Profile: https://replit.com/@EricDunbar1

Try installing a Replit extension, such as Prettier. Based on my experimentation, code formatting is indeed gone on my end.

use CtrlS or the format button next to the currently open code tab.

5 Likes

The problem is that I tried on a js file and nothing popped up for some reason… Maybe I’m using a rogue adblock?

Thank you. To confirm to anyone else looking for this solution, it does work for Python in replit.

PS A favourite of mine is ‘black’ if there is no inbuilt (re)formatter.

1 Like

you just reminded me and I updated my black template to use the updated language server.

3 Likes

This topic was automatically closed 7 days after the last reply. New replies are no longer allowed.