Просмотр исходного кода

Switch from pep257 -> pydocstyle

Ask Solem 8 лет назад
Родитель
Сommit
da66e3a935
7 измененных файлов с 25 добавлено и 10 удалено
  1. 2 2
      Makefile
  2. 2 0
      celery/backends/rpc.py
  3. 1 1
      celery/bin/multi.py
  4. 1 1
      celery/result.py
  5. 1 1
      celery/security/key.py
  6. 2 0
      celery/worker/consumer/consumer.py
  7. 16 5
      tox.ini

+ 2 - 2
Makefile

@@ -6,7 +6,7 @@ GIT=git
 TOX=tox
 ICONV=iconv
 FLAKE8=flake8
-PEP257=pep257
+PYDOCSTYLE=pydocstyle
 PYROMA=pyroma
 FLAKEPLUS=flakeplus
 SPHINX2RST=sphinx2rst
@@ -94,7 +94,7 @@ flakecheck:
 	$(FLAKE8) --ignore=X999 "$(PROJ)" "$(TESTDIR)"
 
 pep257check:
-	$(PEP257) --ignore=D102,D104,D203,D105 "$(PROJ)"
+	$(PYDOCSTYLE) --ignore=D102,D104,D203,D105 "$(PROJ)"
 
 flakediag:
 	-$(MAKE) flakecheck

+ 2 - 0
celery/backends/rpc.py

@@ -269,6 +269,8 @@ class RPCBackend(BaseRPCBackend):
     persistent = False
 
     class Consumer(Consumer):
+        """Consumer that requires manual declaration of queues."""
+
         auto_declare = False
 
     def _create_exchange(self, name, type='direct', delivery_mode=2):

+ 1 - 1
celery/bin/multi.py

@@ -235,7 +235,7 @@ class MultiTool(TermLogger):
 
     def __init__(self, env=None, cmd=None,
                  fh=None, stdout=None, stderr=None, **kwargs):
-        """fh is an old alias to stdout."""
+        # fh is an old alias to stdout.
         self.env = env
         self.cmd = cmd
         self.setup_terminal(stdout or fh, stderr, **kwargs)

+ 1 - 1
celery/result.py

@@ -432,7 +432,7 @@ class AsyncResult(ResultBase):
 
     @property
     def task_id(self):
-        """compat alias to :attr:`id`."""
+        """Compat. alias to :attr:`id`."""
         return self.id
 
     @task_id.setter  # noqa

+ 1 - 1
celery/security/key.py

@@ -17,6 +17,6 @@ class PrivateKey(object):
             self._key = crypto.load_privatekey(crypto.FILETYPE_PEM, key)
 
     def sign(self, data, digest):
-        """sign string containing data."""
+        """Sign string containing data."""
         with reraise_errors('Unable to sign data: {0!r}'):
             return crypto.sign(self._key, ensure_bytes(data), digest)

+ 2 - 0
celery/worker/consumer/consumer.py

@@ -138,6 +138,8 @@ class Consumer(object):
     restart_count = -1  # first start is the same as a restart
 
     class Blueprint(bootsteps.Blueprint):
+        """Consumer blueprint."""
+
         name = 'Consumer'
         default_steps = [
             'celery.worker.consumer.connection:Connection',

+ 16 - 5
tox.ini

@@ -1,5 +1,16 @@
 [tox]
-envlist = 2.7,pypy,3.4,3.5,pypy3,flake8,flakeplus,apicheck,configcheck,cov
+envlist =
+    2.7
+    pypy
+    3.4
+    3.5
+    pypy3
+    flake8
+    flakeplus
+    apicheck
+    configcheck
+    pydocstyle
+    cov
 
 [testenv]
 deps=
@@ -11,7 +22,7 @@ deps=
     pypy,pypy3: -r{toxinidir}/requirements/test-ci-base.txt
 
     linkcheck,apicheck,configcheck: -r{toxinidir}/requirements/docs.txt
-    flake8,flakeplus,pep257: -r{toxinidir}/requirements/pkgutils.txt
+    flake8,flakeplus,pydocstyle -r{toxinidir}/requirements/pkgutils.txt
 sitepackages = False
 recreate = False
 commands = pip install -U -r{toxinidir}/requirements/dev.txt
@@ -23,7 +34,7 @@ basepython =
     3.5: python3.5
     pypy: pypy
     pypy3: pypy3
-    flake8,flakeplus,apicheck,linkcheck,configcheck,pep257,cov: python2.7
+    flake8,flakeplus,apicheck,linkcheck,configcheck,pydocstyle,cov: python2.7
 
 [testenv:cov]
 commands =
@@ -53,6 +64,6 @@ commands =
 commands =
     flakeplus --2.7 {toxinidir}/celery {toxinidir}/t
 
-[testenv:pep257]
+[testenv:pydocstyle]
 commands =
-    pep257 --ignore=D102,D104,D203,D105 celery
+    pydocstyle --ignore=D102,D104,D203,D105 celery