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

Commit d22428e

Browse files
authored
Merge pull request #200 from Nurdok/splitfiles
Refactor - split to modules, add parser tests, update readme
2 parents 2ce9e41 + 62610d6 commit d22428e

22 files changed

+2294
-1848
lines changed

README.rst

Lines changed: 7 additions & 9 deletions
Original file line numberDiff line numberDiff line change
@@ -10,11 +10,6 @@ docstring conventions.
1010
`PEP 257 <http://www.python.org/dev/peps/pep-0257/>`_ out of the box, but it
1111
should not be considered a reference implementation.
1212

13-
The framework for checking docstring style is flexible, and
14-
custom checks can be easily added, for example to cover
15-
NumPy `docstring conventions
16-
<https://github.com/numpy/numpy/blob/master/doc/HOWTO_DOCUMENT.rst.txt>`_.
17-
1813
**pydocstyle** supports Python 2.6, 2.7, 3.3, 3.4, 3.5, pypy and pypy3.
1914

2015
Quick Start
@@ -27,16 +22,19 @@ Install
2722
2823
pip install pydocstyle
2924
25+
3026
Run
31-
^^^
27+
^^^^
3228

3329
.. code::
3430
3531
$ pydocstyle test.py
3632
test.py:18 in private nested class `meta`:
3733
D101: Docstring missing
38-
test.py:22 in public method `method`:
39-
D102: Docstring missing
34+
test.py:27 in public function `get_user`:
35+
D300: Use """triple double quotes""" (found '''-quotes)
36+
test:75 in public function `init_database`:
37+
D201: No blank lines allowed before function docstring (found 1)
4038
...
4139
4240
@@ -50,7 +48,7 @@ Links
5048
:target: https://readthedocs.org/projects/pydocstyle/?badge=latest
5149
:alt: Documentation Status
5250

53-
* `Read the full documentation here <https://pydocstyle.readthedocs.io>`_.
51+
* `Read the full documentation here <https://pydocstyle.org>`_.
5452

5553
* `Fork pydocstyle on GitHub <http://github.com/PyCQA/pydocstyle>`_.
5654

docs/conf.py

Lines changed: 2 additions & 2 deletions
Original file line numberDiff line numberDiff line change
@@ -18,7 +18,7 @@
1818
# If extensions (or modules to document with autodoc) are in another directory,
1919
# add these directories to sys.path here. If the directory is relative to the
2020
# documentation root, use os.path.abspath to make it absolute, like shown here.
21-
sys.path.insert(0, os.path.join(os.path.dirname(__file__), '..'))
21+
sys.path.insert(0, os.path.join(os.path.dirname(__file__), '..', 'src'))
2222

2323
# -- General configuration ------------------------------------------------
2424

@@ -268,7 +268,7 @@
268268

269269

270270
def generate_error_code_table():
271-
from pydocstyle import ErrorRegistry
271+
from pydocstyle.violations import ErrorRegistry
272272
with open(os.path.join('snippets', 'error_code_table.rst'), 'wt') as outf:
273273
outf.write(ErrorRegistry.to_rst())
274274

docs/release_notes.rst

Lines changed: 9 additions & 0 deletions
Original file line numberDiff line numberDiff line change
@@ -7,6 +7,12 @@ Release Notes
77
Current Development Version
88
---------------------------
99

10+
Major Updates
11+
12+
* ``pydocstyle`` is no longer a single file. This might make it difficult for
13+
some users to just add it to their project, but the project has reached
14+
certain complexity where splitting it into modules was necessary (#200).
15+
1016
New Features
1117

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

42+
* Fixed a bug where ``raise X from Y`` syntax caused ``pydocstyle`` to crash
43+
(#196, #200).
44+
3645
1.0.0 - January 30th, 2016
3746
--------------------------
3847

requirements.txt

Lines changed: 2 additions & 0 deletions
Original file line numberDiff line numberDiff line change
@@ -1,2 +1,4 @@
11
-r requirements/docs.txt
22
-r requirements/tests.txt
3+
-r requirements/test_env.txt
4+
-r requirements/runtime.txt

requirements/runtime.txt

Whitespace-only changes.

requirements/test_env.txt

Lines changed: 1 addition & 0 deletions
Original file line numberDiff line numberDiff line change
@@ -0,0 +1 @@
1+
tox

requirements/tests.txt

Lines changed: 4 additions & 4 deletions
Original file line numberDiff line numberDiff line change
@@ -1,4 +1,4 @@
1-
pytest==2.7.3
2-
pytest-pep8
3-
mock
4-
tox
1+
pytest==3.0.2
2+
pytest-pep8==1.0.6
3+
mock==2.0.0
4+
pathlib

setup.py

Lines changed: 6 additions & 4 deletions
Original file line numberDiff line numberDiff line change
@@ -3,7 +3,9 @@
33
from setuptools import setup
44

55

6-
with open(os.path.join('src', 'pydocstyle.py')) as f:
6+
this_dir = os.path.dirname(__file__)
7+
8+
with open(os.path.join(this_dir, 'src', 'pydocstyle', 'utils.py')) as f:
79
for line in f:
810
if line.startswith('__version__'):
911
version = eval(line.split('=')[-1])
@@ -27,12 +29,12 @@
2729
'License :: OSI Approved :: MIT License',
2830
],
2931
keywords='pydocstyle, PEP 257, pep257, PEP 8, pep8, docstrings',
32+
packages=('pydocstyle',),
3033
package_dir={'': 'src'},
31-
py_modules=['pydocstyle'],
3234
entry_points={
3335
'console_scripts': [
34-
'pydocstyle = pydocstyle:main',
35-
'pep257 = pydocstyle:main_pep257',
36+
'pydocstyle = pydocstyle.cli:main',
37+
'pep257 = pydocstyle.cli:main_pep257',
3638
],
3739
},
3840
)

0 commit comments

Comments
 (0)