Skip to content

Commit

Permalink
Swap pep257 with pydocstyle
Browse files Browse the repository at this point in the history
  • Loading branch information
webknjaz committed Jun 16, 2018
1 parent c25ab84 commit 46aa226
Show file tree
Hide file tree
Showing 8 changed files with 16 additions and 13 deletions.
6 changes: 3 additions & 3 deletions .pre-commit-config.yaml
Expand Up @@ -31,10 +31,10 @@ repos:
exclude: cherrypy/test/test.pem
- id: requirements-txt-fixer

- repo: git://github.com/FalconSocial/pre-commit-mirrors-pep257
sha: f464d46
- repo: git://github.com/chewse/pre-commit-mirrors-pydocstyle
sha: v2.1.1
hooks:
- id: pep257
- id: pydocstyle
exclude: |
(?x)
tests/dist|
Expand Down
2 changes: 1 addition & 1 deletion cherrypy/_cpchecker.py
Expand Up @@ -44,7 +44,7 @@ def __call__(self):
warnings.formatwarning = oldformatwarning

def formatwarning(self, message, category, filename, lineno, line=None):
"""Function to format a warning."""
"""Format a warning."""
return 'CherryPy Checker:\n%s\n\n' % message

# This value should be set inside _cpconfig.
Expand Down
2 changes: 1 addition & 1 deletion cherrypy/_cpconfig.py
Expand Up @@ -165,7 +165,7 @@ def _apply(self, config):

@staticmethod
def __call__(*args, **kwargs):
"""Decorator for page handlers to set _cp_config."""
"""Decorate for page handlers to set _cp_config."""
if args:
raise TypeError(
'The cherrypy.config decorator does not accept positional '
Expand Down
2 changes: 1 addition & 1 deletion cherrypy/_cpserver.py
Expand Up @@ -28,7 +28,7 @@ class Server(ServerAdapter):
_socket_host = '127.0.0.1'

@property
def socket_host(self):
def socket_host(self): # noqa: D401; irrelevant for properties
"""The hostname or IP address on which to listen for connections.
Host values may be any IPv4 or IPv6 address, or any valid hostname.
Expand Down
4 changes: 2 additions & 2 deletions cherrypy/_cptree.py
Expand Up @@ -82,7 +82,7 @@ def __repr__(self):
"""

@property
def script_name(self):
def script_name(self): # noqa: D401; irrelevant for properties
"""The URI "mount point" for this app.
A mount point is that portion of the URI which is constant for all URIs
Expand Down Expand Up @@ -261,7 +261,7 @@ def graft(self, wsgi_callable, script_name=''):
self.apps[script_name] = wsgi_callable

def script_name(self, path=None):
"""The script_name of the app at the given path, or None.
"""Return the script_name of the app at the given path, or None.
If path is None, cherrypy.request is used.
"""
Expand Down
9 changes: 6 additions & 3 deletions cherrypy/_helper.py
Expand Up @@ -57,7 +57,7 @@ def expose_(func):


def popargs(*args, **kwargs):
"""A decorator for _cp_dispatch.
"""Decorate _cp_dispatch.
(cherrypy.dispatch.Dispatcher.dispatch_method_name)
Expand Down Expand Up @@ -321,7 +321,10 @@ class _ClassPropertyDescriptor(object):
"""

def __init__(self, fget, fset=None):
"""Instantiated by ``_helper.classproperty``."""
"""Initialize a class property descriptor.
Instantiated by ``_helper.classproperty``.
"""
self.fget = fget
self.fset = fset

Expand All @@ -332,7 +335,7 @@ def __get__(self, obj, klass=None):
return self.fget.__get__(obj, klass)()


def classproperty(func):
def classproperty(func): # noqa: D401; irrelevant for properties
"""Decorator like classmethod to implement a static class property."""
if not isinstance(func, (classmethod, staticmethod)):
func = classmethod(func)
Expand Down
2 changes: 1 addition & 1 deletion cherrypy/process/wspbus.py
Expand Up @@ -249,7 +249,7 @@ def publish(self, channel, *args, **kwargs):
return output

def _clean_exit(self):
"""An atexit handler which asserts the Bus is not running."""
"""Assert that the Bus is not running in atexit handler callback."""
if self.state != states.EXITING:
warnings.warn(
'The main thread is exiting, but the Bus is in the %r state; '
Expand Down
2 changes: 1 addition & 1 deletion setup.py
Expand Up @@ -133,7 +133,7 @@


def main():
"""Package installation entry point."""
"""Run setup as a package installation entry point."""
setuptools.setup(**setup_params)


Expand Down

0 comments on commit 46aa226

Please sign in to comment.