diff --git a/.travis.yml b/.travis.yml index f6dd4cca..80f6e477 100644 --- a/.travis.yml +++ b/.travis.yml @@ -16,7 +16,7 @@ cache: before_install: - sudo apt-get install texlive texlive-latex-extra latexmk dvipng - pip install --upgrade pip setuptools # Upgrade pip and setuptools to get ones with `wheel` support - - pip install pytest pytest-cov numpy matplotlib sphinx${SPHINX_SPEC} codecov + - pip install pytest pytest-cov pydocstyle numpy matplotlib sphinx${SPHINX_SPEC} codecov script: - | python setup.py sdist @@ -28,6 +28,7 @@ script: - echo '! python -m numpydoc numpydoc.tests.test_main._invalid_docstring' | bash - python -m numpydoc --validate numpydoc.tests.test_main._capture_stdout - echo '! python -m numpydoc --validate numpydoc.tests.test_main._docstring_with_errors' | bash + - pydocstyle --convention numpy ../doc/example.py # Build documentation - | cd ../doc diff --git a/doc/example.py b/doc/example.py index c051d4f2..33c55ccb 100644 --- a/doc/example.py +++ b/doc/example.py @@ -1,6 +1,7 @@ -"""This is the docstring for the example.py module. Modules names should -have short, all-lowercase names. The module name may have underscores if -this improves readability. +"""Docstring for the example.py module. + +Modules names should have short, all-lowercase names. The module name may +have underscores if this improves readability. Every module should have a docstring at the very top of the file. The module's docstring may extend over multiple lines. If your docstring does @@ -35,7 +36,7 @@ def foo(var1, var2, long_var_name='hi'): - r"""A one-line summary that does not use variable names. + r"""Summarize the function in one line. Several sentences providing an extended description. Refer to variables using back-ticks, e.g. `var`.