I really should integrate flake8 more decisively into my workflow somehow.
Note: I'm ignoring W503 here since it's contradictory with W504,
(breaking a "line too long" problem at an operator will cause
one of W503 or W504 to fire and there's no way I can see to shut
them both up).
[flake8]
-ignore = E251, E305, E302
+ignore = E251, E305, E302, W503
from flask import current_app
from slack import WebClient
-from slack.errors import SlackApiError
from slack.signature import SignatureVerifier
import os
import requests
"""Send a Slack message to a specified channel."""
slack_client.chat_postMessage(channel=channel, text=text)
-
return {
"type": "home",
"blocks": [
- section(text("This is (or soon will be) a list of available puzzle hunts)")),
+ section(text("This is (or soon will be) a list of "
+ + "available puzzle hunts)")),
actions(button("New hunt", "new_hunt"))
]
}
#!/usr/bin/env python3
-from flask import Flask, request
+from flask import Flask, request, make_response
from slackeventsapi import SlackEventAdapter
from turbot.slack import slack_is_valid_request, slack_send_reply
import os
This implements the Slack signature verification using the slack
signing secret (obtained via an SSM parameter in code above)."""
- content = "v0:{}:{}".format(timestamp,body).encode('utf-8')
+ content = "v0:{}:{}".format(timestamp, body).encode('utf-8')
signature = 'v0=' + hmac.new(slack_signing_secret,
content,