Skip to content

Commit dfc75cc

Browse files
committed
Add docstring style checker and fixing some
1 parent a539a0c commit dfc75cc

32 files changed

Lines changed: 41 additions & 41 deletions

Makefile

Lines changed: 5 additions & 1 deletion
Original file line numberDiff line numberDiff line change
@@ -7,11 +7,14 @@ clean:
77
find . -name '*.pyo' -exec rm -f {} \;
88
find . -name '*~' -exec rm -f {} \;
99

10+
pep257:
11+
pep257 telegram
12+
1013
pep8:
1114
flake8 telegram
1215

1316
lint:
14-
pylint -E telegram
17+
pylint -E telegram --disable=no-name-in-module,import-error
1518

1619
test:
1720
nosetests
@@ -22,6 +25,7 @@ install:
2225
help:
2326
@echo "Available targets:"
2427
@echo "- clean Clean up the source directory"
28+
@echo "- pep257 Check docstring style with pep257"
2529
@echo "- pep8 Check style with flake8"
2630
@echo "- lint Check style with pylint"
2731
@echo "- test Run tests"

requirements-dev.txt

Lines changed: 2 additions & 1 deletion
Original file line numberDiff line numberDiff line change
@@ -1,4 +1,5 @@
11
flake8
22
nose
3+
pep257
34
pylint
4-
unittest2
5+
unittest2

telegram/__init__.py

Lines changed: 2 additions & 2 deletions
Original file line numberDiff line numberDiff line change
@@ -52,9 +52,9 @@
5252
from .jobqueue import JobQueue
5353
from .updater import Updater
5454

55-
__all__ = ['Bot', 'Updater', 'Dispatcher', 'Emoji', 'TelegramError',
55+
__all__ = ('Bot', 'Updater', 'Dispatcher', 'Emoji', 'TelegramError',
5656
'InputFile', 'ReplyMarkup', 'ForceReply', 'ReplyKeyboardHide',
5757
'ReplyKeyboardMarkup', 'UserProfilePhotos', 'ChatAction',
5858
'Location', 'Contact', 'Video', 'Sticker', 'Document', 'File',
5959
'Audio', 'PhotoSize', 'Chat', 'Update', 'ParseMode', 'Message',
60-
'User', 'TelegramObject', 'NullHandler', 'Voice', 'JobQueue']
60+
'User', 'TelegramObject', 'NullHandler', 'Voice', 'JobQueue')

telegram/audio.py

Lines changed: 1 addition & 1 deletion
Original file line numberDiff line numberDiff line change
@@ -17,7 +17,7 @@
1717
# You should have received a copy of the GNU Lesser Public License
1818
# along with this program. If not, see [http://www.gnu.org/licenses/].
1919

20-
"""This module contains a object that represents a Telegram Audio"""
20+
"""This module contains a object that represents a Telegram Audio."""
2121

2222
from telegram import TelegramObject
2323

telegram/base.py

Lines changed: 2 additions & 2 deletions
Original file line numberDiff line numberDiff line change
@@ -17,14 +17,14 @@
1717
# You should have received a copy of the GNU Lesser Public License
1818
# along with this program. If not, see [http://www.gnu.org/licenses/].
1919

20-
"""Base class for Telegram Objects"""
20+
"""Base class for Telegram Objects."""
2121

2222
import json
2323
from abc import ABCMeta
2424

2525

2626
class TelegramObject(object):
27-
"""Base class for most telegram objects"""
27+
"""Base class for most telegram objects."""
2828

2929
__metaclass__ = ABCMeta
3030

telegram/bot.py

Lines changed: 1 addition & 1 deletion
Original file line numberDiff line numberDiff line change
@@ -18,7 +18,7 @@
1818
# You should have received a copy of the GNU Lesser Public License
1919
# along with this program. If not, see [http://www.gnu.org/licenses/].
2020

21-
"""This module contains a object that represents a Telegram Bot"""
21+
"""This module contains a object that represents a Telegram Bot."""
2222

2323
import functools
2424
import logging

telegram/chat.py

Lines changed: 1 addition & 1 deletion
Original file line numberDiff line numberDiff line change
@@ -18,7 +18,7 @@
1818
# You should have received a copy of the GNU Lesser Public License
1919
# along with this program. If not, see [http://www.gnu.org/licenses/].
2020

21-
"""This module contains a object that represents a Telegram Chat"""
21+
"""This module contains a object that represents a Telegram Chat."""
2222

2323
from telegram import TelegramObject
2424

telegram/chataction.py

Lines changed: 1 addition & 1 deletion
Original file line numberDiff line numberDiff line change
@@ -18,7 +18,7 @@
1818
# You should have received a copy of the GNU Lesser Public License
1919
# along with this program. If not, see [http://www.gnu.org/licenses/].
2020

21-
"""This module contains a object that represents a Telegram ChatAction"""
21+
"""This module contains a object that represents a Telegram ChatAction."""
2222

2323

2424
class ChatAction(object):

telegram/contact.py

Lines changed: 1 addition & 1 deletion
Original file line numberDiff line numberDiff line change
@@ -17,7 +17,7 @@
1717
# You should have received a copy of the GNU Lesser Public License
1818
# along with this program. If not, see [http://www.gnu.org/licenses/].
1919

20-
"""This module contains a object that represents a Telegram Contact"""
20+
"""This module contains a object that represents a Telegram Contact."""
2121

2222
from telegram import TelegramObject
2323

telegram/dispatcher.py

Lines changed: 1 addition & 3 deletions
Original file line numberDiff line numberDiff line change
@@ -17,10 +17,8 @@
1717
# You should have received a copy of the GNU Lesser Public License
1818
# along with this program. If not, see [http://www.gnu.org/licenses/].
1919

20+
"""This module contains the Dispatcher class."""
2021

21-
"""
22-
This module contains the Dispatcher class.
23-
"""
2422
import logging
2523
from functools import wraps
2624
from inspect import getargspec

0 commit comments

Comments
 (0)