Default Formatter to Language Standard & Allow Customisation

Describe your feature request

Recently, Replit updated its formatter to let you select between a select few formatters that they chose. In JavaScript/TypeScript, you can use Prettier or the LSP to format your code.

In Python, you can only use the LSP (pyright-extended) which many people including myself do not like.
Instead, I’d like to request that Replit adds Black and autopep8 as formatters as they are the most commonly used Python formatters and are considered standard.
Additionally, I think you should be able to configure the formatter to any package that you want inside the .replit file. Here’s an example of a field for it:

format = "black {file}"

Then, Replit can replace {file} with the path to the current file when the format button or shortcut is pressed.

3 Likes

for now, use the file https://replit.com/@UMARismyname/black#.config/bashrc (ignore the ruff bit), and then install black, like

nix-editor -ha pkgs.black

note that black messes with pragma comments on long lines.

2 Likes