Skip to content
This repository has been archived by the owner on Nov 3, 2023. It is now read-only.

Refactor - split to modules, add parser tests, update readme #200

Merged
merged 21 commits into from
Sep 11, 2016
Merged
Show file tree
Hide file tree
Changes from 19 commits
Commits
File filter

Filter by extension

Filter by extension


Conversations
Failed to load comments.
Loading
Jump to
Jump to file
Failed to load files.
Loading
Diff view
Diff view
16 changes: 7 additions & 9 deletions README.rst
Original file line number Diff line number Diff line change
Expand Up @@ -10,11 +10,6 @@ docstring conventions.
`PEP 257 <http://www.python.org/dev/peps/pep-0257/>`_ out of the box, but it
should not be considered a reference implementation.

The framework for checking docstring style is flexible, and
custom checks can be easily added, for example to cover
NumPy `docstring conventions
<https://github.com/numpy/numpy/blob/master/doc/HOWTO_DOCUMENT.rst.txt>`_.

**pydocstyle** supports Python 2.6, 2.7, 3.3, 3.4, 3.5, pypy and pypy3.

Quick Start
Expand All @@ -27,16 +22,19 @@ Install

pip install pydocstyle


Run
^^^
^^^^

.. code::

$ pydocstyle test.py
test.py:18 in private nested class `meta`:
D101: Docstring missing
test.py:22 in public method `method`:
D102: Docstring missing
test.py:27 in public function `get_user`:
D300: Use """triple double quotes""" (found '''-quotes)
test:75 in public function `init_database`:
D201: No blank lines allowed before function docstring (found 1)
...


Expand All @@ -50,7 +48,7 @@ Links
:target: https://readthedocs.org/projects/pydocstyle/?badge=latest
:alt: Documentation Status

* `Read the full documentation here <https://pydocstyle.readthedocs.io>`_.
* `Read the full documentation here <https://pydocstyle.org>`_.

* `Fork pydocstyle on GitHub <https://github.com/PyCQA/pydocstyle>`_.

Expand Down
4 changes: 2 additions & 2 deletions docs/conf.py
Original file line number Diff line number Diff line change
Expand Up @@ -18,7 +18,7 @@
# If extensions (or modules to document with autodoc) are in another directory,
# add these directories to sys.path here. If the directory is relative to the
# documentation root, use os.path.abspath to make it absolute, like shown here.
sys.path.insert(0, os.path.join(os.path.dirname(__file__), '..'))
sys.path.insert(0, os.path.join(os.path.dirname(__file__), '..', 'src'))

# -- General configuration ------------------------------------------------

Expand Down Expand Up @@ -268,7 +268,7 @@


def generate_error_code_table():
from pydocstyle import ErrorRegistry
from pydocstyle.violations import ErrorRegistry
with open(os.path.join('snippets', 'error_code_table.rst'), 'wt') as outf:
outf.write(ErrorRegistry.to_rst())

Expand Down
9 changes: 9 additions & 0 deletions docs/release_notes.rst
Original file line number Diff line number Diff line change
Expand Up @@ -7,6 +7,12 @@ Release Notes
Current Development Version
---------------------------

Major Updates

* ``pydocstyle`` is no longer a single file. This might make it difficult for
some users to just add it to their project, but the project has reached
certain complexity where splitting it into modules was necessary (#200).

New Features

* Added the optional error codes D212 and D213, for checking whether
Expand All @@ -33,6 +39,9 @@ Bug Fixes
* Fixed a bug where an ``__all__`` error was reported when ``__all__`` was
imported from another module with a different name (#182, #187).

* Fixed a bug where ``raise X from Y`` syntax caused ``pydocstyle`` to crash
(#196, #200).

1.0.0 - January 30th, 2016
--------------------------

Expand Down
2 changes: 2 additions & 0 deletions requirements.txt
Original file line number Diff line number Diff line change
@@ -1,2 +1,4 @@
-r requirements/docs.txt
-r requirements/tests.txt
-r requirements/test_env.txt
-r requirements/runtime.txt
File renamed without changes.
1 change: 1 addition & 0 deletions requirements/test_env.txt
Original file line number Diff line number Diff line change
@@ -0,0 +1 @@
tox
8 changes: 4 additions & 4 deletions requirements/tests.txt
Original file line number Diff line number Diff line change
@@ -1,4 +1,4 @@
pytest==2.7.3
pytest-pep8
mock
tox
pytest==3.0.2
pytest-pep8==1.0.6
mock==2.0.0
pathlib
Copy link
Member

Choose a reason for hiding this comment

The reason will be displayed to describe this comment to others. Learn more.

So, I have a quibble with this file. Is tox a test dependency and the rest are dependencies enumerated in tox, or are these test dependencies and tox is a different kind of requirement?

Copy link
Member Author

Choose a reason for hiding this comment

The reason will be displayed to describe this comment to others. Learn more.

Separated to tests.txt and test_env.txt.

10 changes: 6 additions & 4 deletions setup.py
Original file line number Diff line number Diff line change
Expand Up @@ -3,7 +3,9 @@
from setuptools import setup


with open(os.path.join('src', 'pydocstyle.py')) as f:
this_dir = os.path.dirname(__file__)

with open(os.path.join(this_dir, 'src', 'pydocstyle', 'utils.py')) as f:
for line in f:
if line.startswith('__version__'):
version = eval(line.split('=')[-1])
Expand All @@ -27,12 +29,12 @@
'License :: OSI Approved :: MIT License',
],
keywords='pydocstyle, PEP 257, pep257, PEP 8, pep8, docstrings',
packages=('pydocstyle',),
package_dir={'': 'src'},
py_modules=['pydocstyle'],
entry_points={
'console_scripts': [
'pydocstyle = pydocstyle:main',
'pep257 = pydocstyle:main_pep257',
'pydocstyle = pydocstyle.cli:main',
'pep257 = pydocstyle.cli:main_pep257',
],
},
)
Loading