Skip to content

Commit eef36ac

Browse files
lukegalbraithrussellClaude
andcommitted
Merge main: adopt Ruff + docstring formatting from #1566/#1567
Rebase the Markdown API reference migration onto main now that Ruff (#1566) and docstring formatting/linting (#1567) have landed. - Defer all docstring/formatting ownership to main: dropped this branch's hand-fenced docstring edits across slack_bolt/** so main's ruff-formatted docstrings are the single source. The generator's _reflow_indented_code now fences main's indented examples at generation time. - Regenerated docs/english/reference/** from main's docstrings (234 pages); ruff docstring-code-format now shapes the fenced examples. - Fenced the two column-0 examples in the Falcon adapter docstrings (resource.py, async_resource.py) that _reflow_indented_code cannot reach; these are the only remaining source changes in this PR. - Replaced .flake8 with main's pyproject ruff config; scripts/format.sh and scripts/lint.sh now run ruff. Net PR surface shrinks to the doc tooling (generator, requirements, sidebar, redirects, CI drift job), the generated tree, and 2 fence fixes. Co-Authored-By: Claude <svc-devxp-claude@slack-corp.com>
2 parents 6353313 + 6ca2694 commit eef36ac

171 files changed

Lines changed: 1621 additions & 1390 deletions

File tree

Some content is hidden

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

.flake8

Lines changed: 0 additions & 3 deletions
This file was deleted.

.git-blame-ignore-revs

Lines changed: 6 additions & 0 deletions
Original file line numberDiff line numberDiff line change
@@ -1,2 +1,8 @@
11
# change black settings
22
0e4cd56b69e8f83166cd262f762802b7f18c3d21
3+
4+
# apply ruff format across the codebase (#1566)
5+
5814077ee7ef79eaa4df6e4602260c179536a814
6+
7+
# add docstring formatting + linting (#1567)
8+
5007ee3248fcea2171efa7c293ae9d4a46afa71f

.gitignore

Lines changed: 3 additions & 0 deletions
Original file line numberDiff line numberDiff line change
@@ -35,6 +35,9 @@ pip
3535
# JetBrains PyCharm settings
3636
.idea/
3737

38+
# VS Code settings
39+
.vscode/
40+
3841
tmp.txt
3942
.DS_Store
4043
logs/

AGENTS.md

Lines changed: 4 additions & 4 deletions
Original file line numberDiff line numberDiff line change
@@ -16,7 +16,7 @@ Slack Bolt for Python -- a framework for building Slack apps in Python.
1616

1717
## Environment Setup
1818

19-
You can verify the venv is active by checking `echo $VIRTUAL_ENV`. If tools like `black`, `flake8`, `mypy` or `pytest` are not found, ask the user to activate the venv.
19+
You can verify the venv is active by checking `echo $VIRTUAL_ENV`. If tools like `ruff`, `mypy` or `pytest` are not found, ask the user to activate the venv.
2020

2121
A python virtual environment (`venv`) should be activated before running any commands.
2222

@@ -65,10 +65,10 @@ Always use the project scripts instead of calling `pytest` directly:
6565
### Formatting, Linting, Type Checking
6666

6767
```bash
68-
# Format -- Black, configured in pyproject.toml
68+
# Format -- Ruff formatter (+ lint autofix), configured in pyproject.toml
6969
./scripts/format.sh --no-install
7070

71-
# Lint -- Flake8, configured in .flake8
71+
# Lint -- Ruff linter, configured in pyproject.toml
7272
./scripts/lint.sh --no-install
7373

7474
# Type check -- mypy, configured in pyproject.toml
@@ -210,7 +210,7 @@ The core package has a **single required runtime dependency**: `slack_sdk` (defi
210210
- `test_async.txt` -- test runner deps (`pytest`, `pytest-asyncio`, includes `async_dev.txt`)
211211
- `test.txt` -- test deps without async (`pytest`, `pytest-cov`)
212212
- `test_adapter.txt` -- adapter-specific test deps (`moto`, `boddle`, `sanic-testing`)
213-
- `dev_tools.txt` -- dev tools (`mypy`, `flake8`, `black`)
213+
- `dev_tools.txt` -- dev tools (`mypy`, `ruff`)
214214

215215
When adding a new dependency: add it to the appropriate `requirements/*.txt` file with version constraints, never to `pyproject.toml` `dependencies` (unless it's a core runtime dep, which is very rare).
216216

docs/english/reference/adapter/asgi/aiohttp/index.md

Lines changed: 2 additions & 0 deletions
Original file line numberDiff line numberDiff line change
@@ -18,6 +18,7 @@ def __init__(app: AsyncApp, path: str = '/slack/events')
1818
```
1919

2020
Setup Bolt as an ASGI web framework, this will make your application compatible with ASGI web servers.
21+
2122
This can be used for production deployment.
2223

2324
With the default settings, `http://localhost:3000/slack/events`
@@ -34,6 +35,7 @@ export SLACK_BOT_TOKEN=xoxb-***
3435
uvicorn app:api --port 3000 --log-level debug
3536
```
3637

38+
3739
**Arguments**:
3840

3941
- `app` _AsyncApp_ - Your bolt application

docs/english/reference/adapter/asgi/async_handler.md

Lines changed: 2 additions & 0 deletions
Original file line numberDiff line numberDiff line change
@@ -18,6 +18,7 @@ def __init__(app: AsyncApp, path: str = '/slack/events')
1818
```
1919

2020
Setup Bolt as an ASGI web framework, this will make your application compatible with ASGI web servers.
21+
2122
This can be used for production deployment.
2223

2324
With the default settings, `http://localhost:3000/slack/events`
@@ -34,6 +35,7 @@ export SLACK_BOT_TOKEN=xoxb-***
3435
uvicorn app:api --port 3000 --log-level debug
3536
```
3637

38+
3739
**Arguments**:
3840

3941
- `app` _AsyncApp_ - Your bolt application

docs/english/reference/adapter/asgi/base_handler.md

Lines changed: 3 additions & 3 deletions
Original file line numberDiff line numberDiff line change
@@ -19,20 +19,20 @@ class BaseSlackRequestHandler()
1919
async def dispatch(request: AsgiHttpRequest) -> BoltResponse
2020
```
2121

22-
Dispatches a request to the Bolt App
22+
Dispatches a request to the Bolt App.
2323

2424
#### handle\_installation
2525

2626
```python
2727
async def handle_installation(request: AsgiHttpRequest) -> BoltResponse
2828
```
2929

30-
Handles installation of the OAuthFlow
30+
Handles installation of the OAuthFlow.
3131

3232
#### handle\_callback
3333

3434
```python
3535
async def handle_callback(request: AsgiHttpRequest) -> BoltResponse
3636
```
3737

38-
Handles the callback of the OAuthFlow
38+
Handles the callback of the OAuthFlow.

docs/english/reference/adapter/asgi/builtin/index.md

Lines changed: 2 additions & 0 deletions
Original file line numberDiff line numberDiff line change
@@ -16,6 +16,7 @@ def __init__(app: App, path: str = '/slack/events')
1616
```
1717

1818
Setup Bolt as an ASGI web framework, this will make your application compatible with ASGI web servers.
19+
1920
This can be used for production deployment.
2021

2122
With the default settings, `http://localhost:3000/slack/events`
@@ -32,6 +33,7 @@ export SLACK_BOT_TOKEN=xoxb-***
3233
uvicorn app:api --port 3000 --log-level debug
3334
```
3435

36+
3537
**Arguments**:
3638

3739
- `app` _App_ - Your bolt application

docs/english/reference/adapter/asgi/index.md

Lines changed: 2 additions & 0 deletions
Original file line numberDiff line numberDiff line change
@@ -26,6 +26,7 @@ def __init__(app: App, path: str = '/slack/events')
2626
```
2727

2828
Setup Bolt as an ASGI web framework, this will make your application compatible with ASGI web servers.
29+
2930
This can be used for production deployment.
3031

3132
With the default settings, `http://localhost:3000/slack/events`
@@ -42,6 +43,7 @@ export SLACK_BOT_TOKEN=xoxb-***
4243
uvicorn app:api --port 3000 --log-level debug
4344
```
4445

46+
4547
**Arguments**:
4648

4749
- `app` _App_ - Your bolt application

docs/english/reference/adapter/django/handler.md

Lines changed: 2 additions & 0 deletions
Original file line numberDiff line numberDiff line change
@@ -28,6 +28,7 @@ class DjangoListenerStartHandler(ListenerStartHandler)
2828
```
2929

3030
Django sets DB connections as a thread-local variable per thread.
31+
3132
If the thread is not managed on the Django app side, the connections won't be released by Django.
3233
This handler releases the connections every time a ThreadListenerRunner execution completes.
3334

@@ -44,6 +45,7 @@ class DjangoListenerCompletionHandler(ListenerCompletionHandler)
4445
```
4546

4647
Django sets DB connections as a thread-local variable per thread.
48+
4749
If the thread is not managed on the Django app side, the connections won't be released by Django.
4850
This handler releases the connections every time a ThreadListenerRunner execution completes.
4951

0 commit comments

Comments
 (0)