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

Commit 238141e

Browse files
committed
Merge remote-tracking branch 'refs/remotes/PyCQA/master'
2 parents 8afde1b + 633031b commit 238141e

40 files changed

+3186
-2123
lines changed

.gitignore

Lines changed: 1 addition & 0 deletions
Original file line numberDiff line numberDiff line change
@@ -43,6 +43,7 @@ docs/_*
4343

4444
# virtualenv
4545
venv/
46+
.venvs/
4647

4748
# generated rst
4849
docs/snippets/error_code_table.rst

.travis.yml

Lines changed: 0 additions & 4 deletions
Original file line numberDiff line numberDiff line change
@@ -9,8 +9,6 @@ install: pip install tox
99
script: tox
1010
matrix:
1111
include:
12-
- python: 2.6
13-
env: TOXENV=py26
1412
- python: 2.7
1513
env: TOXENV=py27
1614
- python: 3.3
@@ -21,7 +19,5 @@ matrix:
2119
env: TOXENV=py35
2220
- python: pypy
2321
env: TOXENV=pypy
24-
- python: pypy3
25-
env: TOXENV=pypy3
2622
- python: 2.7
2723
env: TOXENV=docs

README.rst

Lines changed: 8 additions & 10 deletions
Original file line numberDiff line numberDiff line change
@@ -10,12 +10,7 @@ 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-
18-
**pydocstyle** supports Python 2.6, 2.7, 3.3, 3.4, 3.5, pypy and pypy3.
13+
**pydocstyle** supports Python 2.7, 3.3, 3.4, 3.5 and pypy.
1914

2015
Quick Start
2116
-----------
@@ -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 <http://pydocstyle.readthedocs.org>`_.
51+
* `Read the full documentation here <http://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/error_codes.rst

Lines changed: 6 additions & 0 deletions
Original file line numberDiff line numberDiff line change
@@ -16,3 +16,9 @@ check only error codes that are part of the `PEP257
1616

1717
All of the above error codes are checked for by default except for D203,
1818
D212, D213 and D404.
19+
20+
21+
Publicity
22+
---------
23+
24+
.. include:: snippets/publicity.rst

docs/index.rst

Lines changed: 2 additions & 2 deletions
Original file line numberDiff line numberDiff line change
@@ -1,15 +1,15 @@
11
pydocstyle's documentation
22
==========================
33

4-
(formerly pep257)
5-
64
**pydocstyle** is a static analysis tool for checking compliance with Python
75
docstring conventions.
86

97
**pydocstyle** supports most of
108
`PEP 257 <http://www.python.org/dev/peps/pep-0257/>`_ out of the box, but it
119
should not be considered a reference implementation.
1210

11+
**pydocstyle** supports Python 2.7, 3.3, 3.4, 3.5 and pypy.
12+
1313

1414
.. include:: quickstart.rst
1515

docs/quickstart.rst

Lines changed: 4 additions & 2 deletions
Original file line numberDiff line numberDiff line change
@@ -14,8 +14,10 @@ Quick Start
1414
$ pydocstyle test.py
1515
test.py:18 in private nested class `meta`:
1616
D101: Docstring missing
17-
test.py:22 in public method `method`:
18-
D102: Docstring missing
17+
test.py:27 in public function `get_user`:
18+
D300: Use """triple double quotes""" (found '''-quotes)
19+
test:75 in public function `init_database`:
20+
D201: No blank lines allowed before function docstring (found 1)
1921
...
2022
2123
3. Fix your code :)

docs/release_notes.rst

Lines changed: 57 additions & 1 deletion
Original file line numberDiff line numberDiff line change
@@ -7,20 +7,76 @@ Release Notes
77
Current Development Version
88
---------------------------
99

10+
Major Updates
11+
12+
* Support for Python 2.6 has been dropped (#206, #217).
13+
* Support for PyPy3 has been temporarily dropped, until it will be
14+
equivalent to CPython 3.3+ and supported by ``pip`` (#223).
15+
* Support for the ``pep257`` console script has been dropped. Only the
16+
``pydocstyle`` console script should be used (#216, #218).
17+
18+
New Features
19+
20+
* Decorator-based skipping via ``--ignore-decorators`` has been added (#204).
21+
* Support for using pycodestyle style wildcards has been added (#72, #209).
22+
* Superfluous opening quotes are now reported as part of D300 (#166, #225).
23+
* Support for ``numpy`` conventions verification has been added (#129).
24+
25+
Bug Fixes
26+
27+
* Made parser more robust to bad source files (#168, #214)
28+
* Modules are now considered private if their name starts with a single
29+
underscore. This is a bugfix where "public module" (D100) was reported
30+
regardless of module name (#199, #222).
31+
32+
33+
1.1.1 - October 4th, 2016
34+
-------------------------
35+
36+
Bug Fixes
37+
38+
* Fixed an issue where the ``flake8-docstrings`` failed when accessing some
39+
public API from ``pydocstyle``.
40+
41+
42+
1.1.0 - September 29th, 2016
43+
----------------------------
44+
45+
Major Updates
46+
47+
* ``pydocstyle`` is no longer a single file. This might make it difficult for
48+
some users to just add it to their project, but the project has reached
49+
certain complexity where splitting it into modules was necessary (#200).
50+
1051
New Features
1152

1253
* Added the optional error codes D212 and D213, for checking whether
1354
the summary of a multi-line docstring starts at the first line,
1455
respectively at the second line (#174).
1556

16-
* Added D404 - First word of the docstring should not be `This`. It is turned
57+
* Added D404 - First word of the docstring should not be "This". It is turned
1758
off by default (#183).
1859

60+
* Added the ability to ignore specific function and method docstrings with
61+
inline comments:
62+
63+
1. "# noqa" skips all checks.
64+
65+
2. "# noqa: D102,D203" can be used to skip specific checks.
66+
1967
Bug Fixes
2068

69+
* Fixed an issue where file paths were printed in lower case (#179, #181).
70+
2171
* The error code D300 is now also being reported if a docstring has
2272
uppercase literals (``R`` or ``U``) as prefix (#176).
2373

74+
* Fixed a bug where an ``__all__`` error was reported when ``__all__`` was
75+
imported from another module with a different name (#182, #187).
76+
77+
* Fixed a bug where ``raise X from Y`` syntax caused ``pydocstyle`` to crash
78+
(#196, #200).
79+
2480
1.0.0 - January 30th, 2016
2581
--------------------------
2682

docs/snippets/cli.rst

Lines changed: 17 additions & 3 deletions
Original file line numberDiff line numberDiff line change
@@ -17,11 +17,12 @@ Usage
1717
--count print total number of errors to stdout
1818
--select=<codes> choose the basic list of checked errors by specifying
1919
which errors to check for (with a list of comma-
20-
separated error codes). for example:
21-
--select=D101,D202
20+
separated error codes or prefixes). for example:
21+
--select=D101,D2
2222
--ignore=<codes> choose the basic list of checked errors by specifying
2323
which errors to ignore (with a list of comma-separated
24-
error codes). for example: --ignore=D101,D202
24+
error codes or prefixes). for example:
25+
--ignore=D101,D2
2526
--convention=<name> choose the basic list of checked errors by specifying
2627
an existing convention. Possible conventions: pep257
2728
--add-select=<codes> amend the list of errors to check for by specifying
@@ -36,7 +37,20 @@ Usage
3637
search only dirs that exactly match <pattern> regular
3738
expression; default is --match-dir='[^\.].*', which
3839
matches all dirs that don't start with a dot
40+
--ignore-decorators=<decorators>
41+
ignore any functions or methods that are decorated by
42+
a function with a name fitting the <decorators>
43+
regular expression; default is --ignore-decorators=''
44+
which does not ignore any decorated functions.
3945
46+
.. note::
47+
48+
When using any of the ``--select``, ``--ignore``, ``--add-select``, or
49+
``--add-ignore`` command line flags, it is possible to pass a prefix for an
50+
error code. It will be expanded so that any code begining with that prefix
51+
will match. For example, running the command ``pydocstyle --ignore=D4``
52+
will ignore all docstring content issues as their error codes begining with
53+
"D4" (i.e. D400, D401, D402, D403, and D404).
4054

4155
Return Code
4256
^^^^^^^^^^^

docs/snippets/config.rst

Lines changed: 1 addition & 0 deletions
Original file line numberDiff line numberDiff line change
@@ -32,6 +32,7 @@ Available options are:
3232
* ``add_ignore``
3333
* ``match``
3434
* ``match_dir``
35+
* ``ignore_decorators``
3536

3637
See the :ref:`cli_usage` section for more information.
3738

0 commit comments

Comments
 (0)