Skip to content

Commit 319d000

Browse files
seratchfilmaj
andauthored
Enable Flake8 in the CI builds (#638)
Co-authored-by: Fil Maj <[email protected]>
1 parent 8df95d5 commit 319d000

File tree

50 files changed

+115
-77
lines changed

Some content is hidden

Large Commits have some content hidden by default. Use the searchbox below for content that may be hidden.

50 files changed

+115
-77
lines changed

.flake8

Lines changed: 3 additions & 0 deletions
Original file line numberDiff line numberDiff line change
@@ -0,0 +1,3 @@
1+
[flake8]
2+
max-line-length = 125
3+
ignore = F841,F821,W503,E402

.github/workflows/flake8.yml

Lines changed: 23 additions & 0 deletions
Original file line numberDiff line numberDiff line change
@@ -0,0 +1,23 @@
1+
name: Run flake8 validation
2+
3+
on:
4+
push:
5+
branches: [ main ]
6+
pull_request:
7+
8+
jobs:
9+
build:
10+
runs-on: ubuntu-latest
11+
timeout-minutes: 20
12+
strategy:
13+
matrix:
14+
python-version: ['3.9']
15+
steps:
16+
- uses: actions/checkout@v2
17+
- name: Set up Python ${{ matrix.python-version }}
18+
uses: actions/setup-python@v2
19+
with:
20+
python-version: ${{ matrix.python-version }}
21+
- name: Run flake8 verification
22+
run: |
23+
./scripts/run_flake8.sh

examples/django/myslackapp/urls.py

Lines changed: 1 addition & 1 deletion
Original file line numberDiff line numberDiff line change
@@ -13,7 +13,7 @@
1313
1. Import the include() function: from django.urls import include, path
1414
2. Add a URL to urlpatterns: path('blog/', include('blog.urls'))
1515
"""
16-
from django.contrib import admin
16+
from django.contrib import admin # noqa: F401
1717
from django.urls import path
1818

1919
# Set this flag to False if you want to enable oauth_app instead
Lines changed: 1 addition & 1 deletion
Original file line numberDiff line numberDiff line change
@@ -1,3 +1,3 @@
1-
from django.db import models
1+
from django.db import models # noqa: F401
22

33
# Create your models here.

examples/getting_started/app.py

Lines changed: 1 addition & 0 deletions
Original file line numberDiff line numberDiff line change
@@ -7,6 +7,7 @@
77
signing_secret=os.environ.get("SLACK_SIGNING_SECRET"),
88
)
99

10+
1011
# Listens to incoming messages that contain "hello"
1112
# To learn available listener method arguments,
1213
# visit https://slack.dev/bolt-python/api-docs/slack_bolt/kwargs_injection/args.html

examples/google_cloud_functions/main.py

Lines changed: 1 addition & 0 deletions
Original file line numberDiff line numberDiff line change
@@ -26,6 +26,7 @@ def event_test(body, say, logger):
2626

2727
handler = SlackRequestHandler(app)
2828

29+
2930
# Cloud Function
3031
def hello_bolt_app(request):
3132
"""HTTP Cloud Function.

examples/workflow_steps/async_steps_from_apps.py

Lines changed: 3 additions & 3 deletions
Original file line numberDiff line numberDiff line change
@@ -28,7 +28,7 @@ async def edit(ack: AsyncAck, step: dict, configure: AsyncConfigure):
2828
"block_id": "intro-section",
2929
"text": {
3030
"type": "plain_text",
31-
"text": "Create a task in one of the listed projects. The link to the task and other details will be available as variable data in later steps.",
31+
"text": "Create a task in one of the listed projects. The link to the task and other details will be available as variable data in later steps.", # noqa: E501
3232
},
3333
},
3434
{
@@ -155,8 +155,8 @@ async def execute(
155155
"blocks": blocks,
156156
},
157157
)
158-
except:
159-
await fail(error={"message": "Something wrong!"})
158+
except Exception as e:
159+
await fail(error={"message": f"Something wrong! (error: {e})"})
160160

161161

162162
app.step(

examples/workflow_steps/async_steps_from_apps_decorator.py

Lines changed: 1 addition & 1 deletion
Original file line numberDiff line numberDiff line change
@@ -33,7 +33,7 @@ async def edit(ack: AsyncAck, step: dict, configure: AsyncConfigure):
3333
"block_id": "intro-section",
3434
"text": {
3535
"type": "plain_text",
36-
"text": "Create a task in one of the listed projects. The link to the task and other details will be available as variable data in later steps.",
36+
"text": "Create a task in one of the listed projects. The link to the task and other details will be available as variable data in later steps.", # noqa: E501
3737
},
3838
},
3939
{

examples/workflow_steps/async_steps_from_apps_primitive.py

Lines changed: 1 addition & 1 deletion
Original file line numberDiff line numberDiff line change
@@ -27,7 +27,7 @@ async def edit(body: dict, ack: AsyncAck, client: AsyncWebClient):
2727
"block_id": "intro-section",
2828
"text": {
2929
"type": "plain_text",
30-
"text": "Create a task in one of the listed projects. The link to the task and other details will be available as variable data in later steps.",
30+
"text": "Create a task in one of the listed projects. The link to the task and other details will be available as variable data in later steps.", # noqa: E501
3131
},
3232
},
3333
{

examples/workflow_steps/steps_from_apps.py

Lines changed: 1 addition & 1 deletion
Original file line numberDiff line numberDiff line change
@@ -31,7 +31,7 @@ def edit(ack: Ack, step, configure: Configure):
3131
"block_id": "intro-section",
3232
"text": {
3333
"type": "plain_text",
34-
"text": "Create a task in one of the listed projects. The link to the task and other details will be available as variable data in later steps.",
34+
"text": "Create a task in one of the listed projects. The link to the task and other details will be available as variable data in later steps.", # noqa: E501
3535
},
3636
},
3737
{

0 commit comments

Comments
 (0)