Skip to content

Commit 33e6b59

Browse files
WilliamBergaminClaude
andcommitted
chore: enable ruff pydocstyle (D) rules for docstring lint + formatting
Enable Ruff's pydocstyle `D` rules with the google convention and `docstring-code-format`, and fix every resulting violation on docstrings that already exist across slack_bolt/ and examples/. - pyproject.toml: select "D" (google convention); ignore only the missing-docstring rules D100-D107 so no docstrings are invented where none exist; enable docstring-code-format. - Fix all D2xx/D4xx violations on existing docstrings (D205 blank line after summary, D415 terminal punctuation, D417 undocumented params, and safe structural fixes). No docstrings added. - scripts/format.sh: format examples/ too. - scripts/lint.sh: add `ruff format --check` gate so local matches CI. Sync/async docstring pairs updated symmetrically. Co-Authored-By: Claude <svc-devxp-claude@slack-corp.com>
1 parent 5814077 commit 33e6b59

68 files changed

Lines changed: 336 additions & 199 deletions

Some content is hidden

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

examples/django/manage.py

Lines changed: 1 addition & 0 deletions
Original file line numberDiff line numberDiff line change
@@ -1,5 +1,6 @@
11
#!/usr/bin/env python
22
"""Django's command-line utility for administrative tasks."""
3+
34
import os
45
import sys
56

examples/django/myslackapp/asgi.py

Lines changed: 1 addition & 2 deletions
Original file line numberDiff line numberDiff line change
@@ -1,5 +1,4 @@
1-
"""
2-
ASGI config for myslackapp project.
1+
"""ASGI config for myslackapp project.
32
43
It exposes the ASGI callable as a module-level variable named ``application``.
54

examples/django/myslackapp/settings.py

Lines changed: 2 additions & 2 deletions
Original file line numberDiff line numberDiff line change
@@ -1,5 +1,4 @@
1-
"""
2-
Django settings for myslackapp project.
1+
"""Django settings for myslackapp project.
32
43
Generated by 'django-admin startproject' using Django 3.2.3.
54
@@ -9,6 +8,7 @@
98
For the full list of settings and their values, see
109
https://docs.djangoproject.com/en/3.2/ref/settings/
1110
"""
11+
1212
import os
1313
from pathlib import Path
1414

examples/django/myslackapp/urls.py

Lines changed: 3 additions & 1 deletion
Original file line numberDiff line numberDiff line change
@@ -1,7 +1,8 @@
1-
"""myslackapp URL Configuration
1+
"""myslackapp URL Configuration.
22
33
The `urlpatterns` list routes URLs to views. For more information please see:
44
https://docs.djangoproject.com/en/3.2/topics/http/urls/
5+
56
Examples:
67
Function views
78
1. Add an import: from my_app import views
@@ -13,6 +14,7 @@
1314
1. Import the include() function: from django.urls import include, path
1415
2. Add a URL to urlpatterns: path('blog/', include('blog.urls'))
1516
"""
17+
1618
from django.contrib import admin # noqa: F401
1719
from django.urls import path
1820

examples/django/myslackapp/wsgi.py

Lines changed: 1 addition & 2 deletions
Original file line numberDiff line numberDiff line change
@@ -1,5 +1,4 @@
1-
"""
2-
WSGI config for myslackapp project.
1+
"""WSGI config for myslackapp project.
32
43
It exposes the WSGI callable as a module-level variable named ``application``.
54

examples/django/oauth_app/migrations/0001_initial.py

Lines changed: 0 additions & 1 deletion
Original file line numberDiff line numberDiff line change
@@ -4,7 +4,6 @@
44

55

66
class Migration(migrations.Migration):
7-
87
initial = True
98

109
dependencies = []

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

Lines changed: 0 additions & 1 deletion
Original file line numberDiff line numberDiff line change
@@ -5,7 +5,6 @@
55

66

77
class Migration(migrations.Migration):
8-
98
dependencies = [
109
("oauth_app", "0001_initial"),
1110
]

examples/google_cloud_functions/oauth_main.py

Lines changed: 1 addition & 0 deletions
Original file line numberDiff line numberDiff line change
@@ -52,6 +52,7 @@ def event_test(body, say, logger):
5252
# Cloud Function
5353
def hello_bolt_app(req: Request):
5454
"""HTTP Cloud Function.
55+
5556
Args:
5657
req (flask.Request): The request object.
5758
<https://flask.palletsprojects.com/en/1.1.x/api/#incoming-request-data>

examples/google_cloud_functions/simple_main.py

Lines changed: 1 addition & 0 deletions
Original file line numberDiff line numberDiff line change
@@ -32,6 +32,7 @@ def event_test(body, say, logger):
3232
# Cloud Function
3333
def hello_bolt_app(req: Request):
3434
"""HTTP Cloud Function.
35+
3536
Args:
3637
req (flask.Request): The request object.
3738
<https://flask.palletsprojects.com/en/1.1.x/api/#incoming-request-data>

examples/message_events.py

Lines changed: 1 addition & 2 deletions
Original file line numberDiff line numberDiff line change
@@ -46,8 +46,7 @@ def reply_in_thread(body: dict, say: Say):
4646
event={"type": "message", "subtype": "message_deleted"},
4747
matchers=[
4848
# Skip the deletion of messages by this listener
49-
lambda body: "You've deleted a message: "
50-
not in body["event"]["previous_message"]["text"]
49+
lambda body: "You've deleted a message: " not in body["event"]["previous_message"]["text"]
5150
],
5251
)
5352
def detect_deletion(say: Say, body: dict):

0 commit comments

Comments
 (0)