Skip to content

Commit 60c69fc

Browse files
committed
Apply black formatter to examples and tests
1 parent 421c0d0 commit 60c69fc

25 files changed

+47
-142
lines changed

examples/aws_chalice/app.py

Lines changed: 1 addition & 3 deletions
Original file line numberDiff line numberDiff line change
@@ -25,9 +25,7 @@ def say_it(say):
2525
say("Done!")
2626

2727

28-
bolt_app.command("/hello-bolt-python-chalice")(
29-
ack=respond_to_slack_within_3_seconds, lazy=[say_it]
30-
)
28+
bolt_app.command("/hello-bolt-python-chalice")(ack=respond_to_slack_within_3_seconds, lazy=[say_it])
3129

3230
ChaliceSlackRequestHandler.clear_all_log_handlers()
3331
logging.basicConfig(format="%(asctime)s %(message)s", level=logging.DEBUG)

examples/django/myslackapp/settings.py

Lines changed: 1 addition & 3 deletions
Original file line numberDiff line numberDiff line change
@@ -20,9 +20,7 @@
2020
# See https://docs.djangoproject.com/en/3.2/howto/deployment/checklist/
2121

2222
# TODO: CHANGE THIS IF YOU REUSE THIS APP
23-
SECRET_KEY = (
24-
"This is just a example. You should not expose your secret key in real apps"
25-
)
23+
SECRET_KEY = "This is just a example. You should not expose your secret key in real apps"
2624

2725
# SECURITY WARNING: don't run with debug turned on in production!
2826
DEBUG = True

examples/django/oauth_app/migrations/0002_token_rotation.py

Lines changed: 5 additions & 15 deletions
Original file line numberDiff line numberDiff line change
@@ -11,21 +11,11 @@ class Migration(migrations.Migration):
1111
]
1212

1313
operations = [
14-
migrations.AddField(
15-
"SlackBot", "bot_refresh_token", models.TextField(null=True)
16-
),
17-
migrations.AddField(
18-
"SlackBot", "bot_token_expires_at", models.DateTimeField(null=True)
19-
),
20-
migrations.AddField(
21-
"SlackInstallation", "bot_refresh_token", models.TextField(null=True)
22-
),
23-
migrations.AddField(
24-
"SlackInstallation", "bot_token_expires_at", models.DateTimeField(null=True)
25-
),
26-
migrations.AddField(
27-
"SlackInstallation", "user_refresh_token", models.TextField(null=True)
28-
),
14+
migrations.AddField("SlackBot", "bot_refresh_token", models.TextField(null=True)),
15+
migrations.AddField("SlackBot", "bot_token_expires_at", models.DateTimeField(null=True)),
16+
migrations.AddField("SlackInstallation", "bot_refresh_token", models.TextField(null=True)),
17+
migrations.AddField("SlackInstallation", "bot_token_expires_at", models.DateTimeField(null=True)),
18+
migrations.AddField("SlackInstallation", "user_refresh_token", models.TextField(null=True)),
2919
migrations.AddField(
3020
"SlackInstallation",
3121
"user_token_expires_at",

examples/django/oauth_app/models.py

Lines changed: 1 addition & 3 deletions
Original file line numberDiff line numberDiff line change
@@ -23,9 +23,7 @@ class SlackBot(models.Model):
2323

2424
class Meta:
2525
indexes = [
26-
models.Index(
27-
fields=["client_id", "enterprise_id", "team_id", "installed_at"]
28-
),
26+
models.Index(fields=["client_id", "enterprise_id", "team_id", "installed_at"]),
2927
]
3028

3129

examples/falcon/async_app.py

Lines changed: 1 addition & 3 deletions
Original file line numberDiff line numberDiff line change
@@ -9,9 +9,7 @@
99

1010

1111
# @app.command("/bolt-py-proto", [lambda body: body["team_id"] == "T03E94MJU"])
12-
async def test_command(
13-
logger: logging.Logger, body: dict, ack: AsyncAck, respond: AsyncRespond
14-
):
12+
async def test_command(logger: logging.Logger, body: dict, ack: AsyncAck, respond: AsyncRespond):
1513
logger.info(body)
1614
await ack("thanks!")
1715
await respond(

examples/falcon/async_oauth_app.py

Lines changed: 1 addition & 3 deletions
Original file line numberDiff line numberDiff line change
@@ -9,9 +9,7 @@
99

1010

1111
# @app.command("/bolt-py-proto", [lambda body: body["team_id"] == "T03E94MJU"])
12-
async def test_command(
13-
logger: logging.Logger, body: dict, ack: AsyncAck, respond: AsyncRespond
14-
):
12+
async def test_command(logger: logging.Logger, body: dict, ack: AsyncAck, respond: AsyncRespond):
1513
logger.info(body)
1614
await ack("thanks!")
1715
await respond(

examples/google_cloud_functions/datastore.py

Lines changed: 3 additions & 11 deletions
Original file line numberDiff line numberDiff line change
@@ -48,11 +48,7 @@ def installation_key(
4848
):
4949
enterprise_id = enterprise_id or "none"
5050
team_id = "none" if is_enterprise_install else team_id or "none"
51-
name = (
52-
f"{enterprise_id}-{team_id}-{user_id}"
53-
if user_id
54-
else f"{enterprise_id}-{team_id}"
55-
)
51+
name = f"{enterprise_id}-{team_id}-{user_id}" if user_id else f"{enterprise_id}-{team_id}"
5652
if suffix is not None:
5753
name += "-" + suffix
5854
return self.datastore_client.key("installations", name)
@@ -208,9 +204,7 @@ def delete_all(
208204
team_id: Optional[str],
209205
):
210206
self.delete_bot(enterprise_id=enterprise_id, team_id=team_id)
211-
self.delete_installation(
212-
enterprise_id=enterprise_id, team_id=team_id, user_id=None
213-
)
207+
self.delete_installation(enterprise_id=enterprise_id, team_id=team_id, user_id=None)
214208

215209

216210
class GoogleDatastoreOAuthStateStore(OAuthStateStore):
@@ -244,9 +238,7 @@ def consume(self, state: str) -> bool:
244238

245239
def issue(self, *args, **kwargs) -> str:
246240
state_value = str(uuid4())
247-
entity: Entity = datastore.Entity(
248-
key=self.datastore_client.key(self.collection_id, state_value)
249-
)
241+
entity: Entity = datastore.Entity(key=self.datastore_client.key(self.collection_id, state_value))
250242
entity.update(value=state_value)
251243
self.datastore_client.put(entity)
252244
return state_value

examples/lazy_async_modals_app.py

Lines changed: 1 addition & 3 deletions
Original file line numberDiff line numberDiff line change
@@ -102,9 +102,7 @@ async def open_modal(body, client, logger):
102102

103103
@app.options("es_a")
104104
async def show_options(ack):
105-
await ack(
106-
{"options": [{"text": {"type": "plain_text", "text": "Maru"}, "value": "maru"}]}
107-
)
105+
await ack({"options": [{"text": {"type": "plain_text", "text": "Maru"}, "value": "maru"}]})
108106

109107

110108
@app.options("mes_a")

examples/lazy_modals_app.py

Lines changed: 1 addition & 3 deletions
Original file line numberDiff line numberDiff line change
@@ -103,9 +103,7 @@ def open_modal(body, client, logger):
103103

104104
@app.options("es_a")
105105
def show_options(ack):
106-
ack(
107-
{"options": [{"text": {"type": "plain_text", "text": "Maru"}, "value": "maru"}]}
108-
)
106+
ack({"options": [{"text": {"type": "plain_text", "text": "Maru"}, "value": "maru"}]})
109107

110108

111109
@app.options("mes_a")

examples/message_events.py

Lines changed: 1 addition & 3 deletions
Original file line numberDiff line numberDiff line change
@@ -61,9 +61,7 @@ def detect_deletion(say: Say, body: dict):
6161
event={"type": "message", "subtype": re.compile("(me_message)|(file_share)")},
6262
middleware=[extract_subtype],
6363
)
64-
def add_reaction(
65-
body: dict, client: WebClient, context: BoltContext, logger: logging.Logger
66-
):
64+
def add_reaction(body: dict, client: WebClient, context: BoltContext, logger: logging.Logger):
6765
subtype = context["subtype"] # by extract_subtype
6866
logger.info(f"subtype: {subtype}")
6967
message_ts = body["event"]["ts"]

0 commit comments

Comments
 (0)