Visitar URL original
chore: add docstring formatting + linting (#139) · slackapi/python-slack-hooks@be24216 · GitHub
Skip to content

Commit be24216

Browse files
WilliamBergaminClaude
andauthored
chore: add docstring formatting + linting (#139)
Co-authored-by: Claude <svc-devxp-claude@slack-corp.com>
1 parent adb72ad commit be24216

7 files changed

Lines changed: 36 additions & 20 deletions

File tree

‎pyproject.toml‎

Lines changed: 18 additions & 1 deletion
Original file line numberDiff line numberDiff line change
@@ -45,7 +45,24 @@ dependencies = { file = ["requirements.txt"] }
4545
line-length = 125
4646

4747
[tool.ruff.lint]
48-
select = ["E", "W", "F"]
48+
select = ["E", "W", "F", "D"]
49+
ignore = [
50+
# missing-docstring: do not add docstrings where none exist
51+
"D100",
52+
"D101",
53+
"D102",
54+
"D103",
55+
"D104",
56+
"D105",
57+
"D106",
58+
"D107",
59+
]
60+
61+
[tool.ruff.lint.pydocstyle]
62+
convention = "google"
63+
64+
[tool.ruff.format]
65+
docstring-code-format = true
4966

5067
[tool.pytest.ini_options]
5168
testpaths = ["tests"]

‎slack_cli_hooks/__init__.py‎

Lines changed: 1 addition & 2 deletions
Original file line numberDiff line numberDiff line change
@@ -1,5 +1,4 @@
1-
"""
2-
A Slack CLI hooks implementation in Python to build Bolt Slack apps leveraging the full power of the [Slack CLI](https://tools.slack.dev/slack-cli/). Read the [quickstart](https://tools.slack.dev/bolt-python/getting-started/) to learn how to build apps using the Slack CLI and Bolt.
1+
"""A Slack CLI hooks implementation in Python to build Bolt Slack apps leveraging the full power of the [Slack CLI](https://tools.slack.dev/slack-cli/). Read the [quickstart](https://tools.slack.dev/bolt-python/getting-started/) to learn how to build apps using the Slack CLI and Bolt.
32
43
* Slack CLI: https://tools.slack.dev/slack-cli/
54
* Bolt Website: https://slack.dev/bolt-python/

‎slack_cli_hooks/error/__init__.py‎

Lines changed: 2 additions & 2 deletions
Original file line numberDiff line numberDiff line change
@@ -1,6 +1,6 @@
11
class CliError(Exception):
2-
"""General class for cli error"""
2+
"""General class for cli error."""
33

44

55
class PypiError(Exception):
6-
"""General class for PyPI package info retrieval error"""
6+
"""General class for PyPI package info retrieval error."""

‎slack_cli_hooks/protocol/default_protocol.py‎

Lines changed: 4 additions & 4 deletions
Original file line numberDiff line numberDiff line change
@@ -5,19 +5,19 @@ class DefaultProtocol(Protocol):
55
name: str = "default"
66

77
def debug(self, msg: str, *args, **kwargs):
8-
"""Nothing will be logged here"""
8+
"""Nothing will be logged here."""
99
pass
1010

1111
def info(self, msg: str, *args, **kwargs):
12-
"""Nothing will be logged here"""
12+
"""Nothing will be logged here."""
1313
pass
1414

1515
def warning(self, msg: str, *args, **kwargs):
16-
"""Nothing will be logged here"""
16+
"""Nothing will be logged here."""
1717
pass
1818

1919
def error(self, msg: str, *args, **kwargs):
20-
"""Nothing will be logged here"""
20+
"""Nothing will be logged here."""
2121
pass
2222

2323
def respond(self, data: str):

‎slack_cli_hooks/protocol/protocol.py‎

Lines changed: 5 additions & 5 deletions
Original file line numberDiff line numberDiff line change
@@ -20,25 +20,25 @@ def __subclasshook__(cls, subclass):
2020

2121
@abc.abstractmethod
2222
def debug(self, msg: str, *args, **kwargs):
23-
"""Logs a message with level DEBUG"""
23+
"""Logs a message with level DEBUG."""
2424
raise NotImplementedError
2525

2626
@abc.abstractmethod
2727
def info(self, msg: str, *args, **kwargs):
28-
"""Logs a message with level INFO"""
28+
"""Logs a message with level INFO."""
2929
raise NotImplementedError
3030

3131
@abc.abstractmethod
3232
def warning(self, msg: str, *args, **kwargs):
33-
"""Logs a message with level WARNING"""
33+
"""Logs a message with level WARNING."""
3434
raise NotImplementedError
3535

3636
@abc.abstractmethod
3737
def error(self, msg: str, *args, **kwargs):
38-
"""Logs a message with level ERROR on the root logger"""
38+
"""Logs a message with level ERROR on the root logger."""
3939
raise NotImplementedError
4040

4141
@abc.abstractmethod
4242
def respond(self, data: str):
43-
"""Utility method for responding to CLI hook invocations"""
43+
"""Utility method for responding to CLI hook invocations."""
4444
raise NotImplementedError

‎slack_cli_hooks/version.py‎

Lines changed: 1 addition & 1 deletion
Original file line numberDiff line numberDiff line change
@@ -1,3 +1,3 @@
1-
"""Check the latest version at https://pypi.org/project/slack-cli-hooks/"""
1+
"""Check the latest version at https://pypi.org/project/slack-cli-hooks/."""
22

33
__version__ = "0.3.0"

‎tests/mock_protocol.py‎

Lines changed: 5 additions & 5 deletions
Original file line numberDiff line numberDiff line change
@@ -4,27 +4,27 @@
44

55

66
def debug(self, msg: str, *args, **kwargs):
7-
"""This is a mock"""
7+
"""This is a mock."""
88
pass
99

1010

1111
def info(self, msg: str, *args, **kwargs):
12-
"""This is a mock"""
12+
"""This is a mock."""
1313
pass
1414

1515

1616
def warning(self, msg: str, *args, **kwargs):
17-
"""This is a mock"""
17+
"""This is a mock."""
1818
pass
1919

2020

2121
def error(self, msg: str, *args, **kwargs):
22-
"""This is a mock"""
22+
"""This is a mock."""
2323
pass
2424

2525

2626
def respond(self, data: str):
27-
"""This is a mock"""
27+
"""This is a mock."""
2828
pass
2929

3030

0 commit comments

Comments
 (0)