You do not have permission to delete messages in this group
Copy link
Report message
Show original message
Either email addresses are anonymous for this group or you need the view member email addresses permission to view the original message
to BBEdit Talk
Hi,
I'm trying to create a very simple text filter that uses Black to format Python code. According to their documentation, Black supports formatting code via stdin, with the result being printed to stdout. So my text filter is simply:
#!/bin/bash
black -
Script output says that the reformat was successful, yet my file doesn't change. Anyone has experience with using Black in BBEdit?
Maxime Pigeon
unread,
Sep 4, 2021, 7:25:20 PM9/4/21
Reply to author
Sign in to reply to author
Forward
Sign in to forward
Delete
You do not have permission to delete messages in this group
Copy link
Report message
Show original message
Either email addresses are anonymous for this group or you need the view member email addresses permission to view the original message
to BBEdit Talk
For reference, I ended up using Black's (private) method format_str() like so:
#!/usr/bin/env python3
import sys
from black import format_str
from black.mode import Mode
stdin = sys.stdin.read()
stdout = format_str(stdin, mode=Mode())
print(stdout, end="")
Still, it would be nice to know what's wrong with the previous code.
jj
unread,
Sep 5, 2021, 1:44:01 PM9/5/21
Reply to author
Sign in to reply to author
Forward
Sign in to forward
Delete
You do not have permission to delete messages in this group
Copy link
Report message
Show original message
Either email addresses are anonymous for this group or you need the view member email addresses permission to view the original message
to BBEdit Talk
Hi Maxime,
Passing the --quiet flag seems to do the trick.
#!/bin/bash
black -q -
HTH
Jean Jourdain
Maxime Pigeon
unread,
Sep 5, 2021, 4:04:31 PM9/5/21
Reply to author
Sign in to reply to author
Forward
Sign in to forward
Delete
You do not have permission to delete messages in this group
Copy link
Report message
Show original message
Either email addresses are anonymous for this group or you need the view member email addresses permission to view the original message