diff options
author | Sviatoslav Sydorenko <wk@sydorenko.org.ua> | 2018-06-16 17:08:51 +0200 |
---|---|---|
committer | Sviatoslav Sydorenko <wk@sydorenko.org.ua> | 2018-06-16 17:08:51 +0200 |
commit | 46aa2267136763ecae8d4997b0f9bfc0e04b5176 (patch) | |
tree | 5cbf1edd505e57088fbba9ff1ede4ebd69714a16 | |
parent | c25ab8410d4cc838859739325826623e690e4a44 (diff) | |
download | cherrypy-git-46aa2267136763ecae8d4997b0f9bfc0e04b5176.tar.gz |
Swap pep257 with pydocstyle
-rw-r--r-- | .pre-commit-config.yaml | 6 | ||||
-rw-r--r-- | cherrypy/_cpchecker.py | 2 | ||||
-rw-r--r-- | cherrypy/_cpconfig.py | 2 | ||||
-rw-r--r-- | cherrypy/_cpserver.py | 2 | ||||
-rw-r--r-- | cherrypy/_cptree.py | 4 | ||||
-rw-r--r-- | cherrypy/_helper.py | 9 | ||||
-rw-r--r-- | cherrypy/process/wspbus.py | 2 | ||||
-rwxr-xr-x | setup.py | 2 |
8 files changed, 16 insertions, 13 deletions
diff --git a/.pre-commit-config.yaml b/.pre-commit-config.yaml index fd3d8ec4..8a627512 100644 --- a/.pre-commit-config.yaml +++ b/.pre-commit-config.yaml @@ -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| diff --git a/cherrypy/_cpchecker.py b/cherrypy/_cpchecker.py index 0066cd5a..39b7c972 100644 --- a/cherrypy/_cpchecker.py +++ b/cherrypy/_cpchecker.py @@ -44,7 +44,7 @@ class Checker(object): 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. diff --git a/cherrypy/_cpconfig.py b/cherrypy/_cpconfig.py index af6c18e2..072219f9 100644 --- a/cherrypy/_cpconfig.py +++ b/cherrypy/_cpconfig.py @@ -165,7 +165,7 @@ class Config(reprconf.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 ' diff --git a/cherrypy/_cpserver.py b/cherrypy/_cpserver.py index b0703460..0f60e2c8 100644 --- a/cherrypy/_cpserver.py +++ b/cherrypy/_cpserver.py @@ -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. diff --git a/cherrypy/_cptree.py b/cherrypy/_cptree.py index e5a54aee..ceb54379 100644 --- a/cherrypy/_cptree.py +++ b/cherrypy/_cptree.py @@ -82,7 +82,7 @@ class Application(object): """ @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 @@ -261,7 +261,7 @@ class Tree(object): 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. """ diff --git a/cherrypy/_helper.py b/cherrypy/_helper.py index a0ab68fe..314550cb 100644 --- a/cherrypy/_helper.py +++ b/cherrypy/_helper.py @@ -57,7 +57,7 @@ def expose(func=None, alias=None): def popargs(*args, **kwargs): - """A decorator for _cp_dispatch. + """Decorate _cp_dispatch. (cherrypy.dispatch.Dispatcher.dispatch_method_name) @@ -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 @@ -332,7 +335,7 @@ class _ClassPropertyDescriptor(object): 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) diff --git a/cherrypy/process/wspbus.py b/cherrypy/process/wspbus.py index 2fe4159b..459e4b0c 100644 --- a/cherrypy/process/wspbus.py +++ b/cherrypy/process/wspbus.py @@ -249,7 +249,7 @@ class Bus(object): 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; ' @@ -133,7 +133,7 @@ setup_params = dict( def main(): - """Package installation entry point.""" + """Run setup as a package installation entry point.""" setuptools.setup(**setup_params) |