jazzband / geojson

Python bindings and utilities for GeoJSON
https://pypi.python.org/pypi/geojson/
BSD 3-Clause "New" or "Revised" License
908 stars 120 forks source link

PEP257 compliant function/class documentations #51

Closed chrisvoncsefalvay closed 9 years ago

chrisvoncsefalvay commented 9 years ago

Params are documented with rST docstrings that can be parsed by Sphinx etc.

Fixes #50

frewsxcv commented 9 years ago

Awesome work! I'll look over this tonight

frewsxcv commented 9 years ago

@chrisvoncsefalvay Check out the errors that Travis CI caught

chrisvoncsefalvay commented 9 years ago

@frewsxcv Ah, Travis was being a PEP8 Nazi :) this should pass, hopefully.

frewsxcv commented 9 years ago

Looks like there's one more error (line length)

chrisvoncsefalvay commented 9 years ago

Here we go. Praying time ;)

chrisvoncsefalvay commented 9 years ago

@frewsxcv Good now ;) sorry 'bout that!

groteworld commented 9 years ago

One opinionated linter down, one to go.

python-geojson|pr/51 ⇒ pep257 .
./setup.py:1 at module level:
        D100: Docstring missing
./setup.py:10 in public function `test_suite`:
        D103: Docstring missing
Could not evaluate contents of __all__. That means pep257 cannot decide which definitions are public. Variable __all__ should be present at most once in each file, in form `__all__ = ('a_public_function', 'APublicClass', ...)`. More info on __all__: http://stackoverflow.com/q/44834/. 
./geojson/base.py:1 at module level:
        D100: Docstring missing
./geojson/base.py:7 in public class `GeoJSON`:
        D203: Expected 1 blank line *before* class docstring, found 0
./geojson/base.py:7 in public class `GeoJSON`:
        D200: One-line docstring should not occupy 3 lines
./geojson/base.py:12 in public method `__init__`:
        D401: First line should be imperative: 'Initialise', not 'Initialises'
./geojson/base.py:12 in public method `__init__`:
        D400: First line should end with '.', not 't'
./geojson/base.py:26 in public method `__repr__`:
        D102: Docstring missing
./geojson/base.py:31 in public method `__getattr__`:
        D400: First line should end with '.', not 's'
./geojson/base.py:44 in public method `__setattr__`:
        D202: No blank lines allowed *after* method docstring, found 1
./geojson/base.py:55 in public method `__delattr__`:
        D400: First line should end with '.', not 's'
./geojson/base.py:55 in public method `__delattr__`:
        D202: No blank lines allowed *after* method docstring, found 1
./geojson/base.py:66 in public method `__geo_interface__`:
        D102: Docstring missing
./geojson/base.py:71 in public method `to_instance`:
        D205: Blank line missing between one-line summary and description
./geojson/codec.py:1 at module level:
        D100: Docstring missing
./geojson/codec.py:11 in public class `GeoJSONEncoder`:
        D101: Docstring missing
./geojson/codec.py:13 in public method `default`:
        D102: Docstring missing
./geojson/codec.py:26 in public function `dump`:
        D103: Docstring missing
./geojson/codec.py:31 in public function `dumps`:
        D103: Docstring missing
./geojson/codec.py:36 in public function `load`:
        D103: Docstring missing
./geojson/codec.py:47 in public function `loads`:
        D103: Docstring missing
./geojson/crs.py:1 at module level:
        D100: Docstring missing
./geojson/crs.py:4 in public class `CoordinateReferenceSystem`:
        D203: Expected 1 blank line *before* class docstring, found 0
./geojson/crs.py:4 in public class `CoordinateReferenceSystem`:
        D200: One-line docstring should not occupy 3 lines
./geojson/crs.py:9 in public method `__init__`:
        D102: Docstring missing
./geojson/crs.py:14 in public class `Named`:
        D203: Expected 1 blank line *before* class docstring, found 0
./geojson/crs.py:14 in public class `Named`:
        D200: One-line docstring should not occupy 3 lines
./geojson/crs.py:19 in public method `__init__`:
        D102: Docstring missing
./geojson/crs.py:23 in public method `__repr__`:
        D102: Docstring missing
./geojson/crs.py:27 in public class `Linked`:
        D203: Expected 1 blank line *before* class docstring, found 0
./geojson/crs.py:27 in public class `Linked`:
        D200: One-line docstring should not occupy 3 lines
./geojson/crs.py:32 in public method `__init__`:
        D102: Docstring missing
./geojson/examples.py:1 at module level:
        D100: Docstring missing
./geojson/examples.py:2 in public class `SimpleWebFeature`:
        D200: One-line docstring should not occupy 3 lines
./geojson/examples.py:8 in public method `__init__`:
        D401: First line should be imperative: 'Initialise', not 'Initialises'
./geojson/examples.py:33 in public method `as_dict`:
        D102: Docstring missing
./geojson/examples.py:50 in public function `createSimpleWebFeature`:
        D205: Blank line missing between one-line summary and description
./geojson/examples.py:50 in public function `createSimpleWebFeature`:
        D400: First line should end with '.', not 't'
Could not evaluate contents of __all__. That means pep257 cannot decide which definitions are public. Variable __all__ should be present at most once in each file, in form `__all__ = ('a_public_function', 'APublicClass', ...)`. More info on __all__: http://stackoverflow.com/q/44834/. 
./geojson/feature.py:1 at module level:
        D205: Blank line missing between one-line summary and description
./geojson/feature.py:1 at module level:
        D400: First line should end with '.', not 'o'
./geojson/feature.py:9 in public class `Feature`:
        D203: Expected 1 blank line *before* class docstring, found 0
./geojson/feature.py:9 in public class `Feature`:
        D200: One-line docstring should not occupy 3 lines
./geojson/feature.py:14 in public method `__init__`:
        D401: First line should be imperative: 'Initialise', not 'Initialises'
./geojson/feature.py:33 in public class `FeatureCollection`:
        D203: Expected 1 blank line *before* class docstring, found 0
./geojson/feature.py:33 in public class `FeatureCollection`:
        D200: One-line docstring should not occupy 3 lines
./geojson/feature.py:38 in public method `__init__`:
        D401: First line should be imperative: 'Initialise', not 'Initialises'
./geojson/feature.py:38 in public method `__init__`:
        D205: Blank line missing between one-line summary and description
./geojson/feature.py:38 in public method `__init__`:
        D400: First line should end with '.', not 'e'
./geojson/geometry.py:1 at module level:
        D100: Docstring missing
./geojson/geometry.py:6 in public class `Geometry`:
        D203: Expected 1 blank line *before* class docstring, found 0
./geojson/geometry.py:6 in public class `Geometry`:
        D200: One-line docstring should not occupy 3 lines
./geojson/geometry.py:11 in public method `__init__`:
        D401: First line should be imperative: 'Initialise', not 'Initialises'
./geojson/geometry.py:11 in public method `__init__`:
        D202: No blank lines allowed *after* method docstring, found 1
./geojson/geometry.py:28 in public method `clean_coordinates`:
        D102: Docstring missing
./geojson/geometry.py:36 in public class `GeometryCollection`:
        D203: Expected 1 blank line *before* class docstring, found 0
./geojson/geometry.py:36 in public class `GeometryCollection`:
        D200: One-line docstring should not occupy 3 lines
./geojson/geometry.py:41 in public method `__init__`:
        D102: Docstring missing
./geojson/geometry.py:48 in public class `Point`:
        D101: Docstring missing
./geojson/geometry.py:52 in public class `MultiPoint`:
        D101: Docstring missing
./geojson/geometry.py:56 in public class `LineString`:
        D101: Docstring missing
./geojson/geometry.py:60 in public class `MultiLineString`:
        D101: Docstring missing
./geojson/geometry.py:64 in public class `Polygon`:
        D101: Docstring missing
./geojson/geometry.py:68 in public class `MultiPolygon`:
        D101: Docstring missing
./geojson/geometry.py:72 in public class `Default`:
        D203: Expected 1 blank line *before* class docstring, found 0
./geojson/geometry.py:72 in public class `Default`:
        D200: One-line docstring should not occupy 3 lines
./geojson/mapping.py:1 at module level:
        D100: Docstring missing
./geojson/mapping.py:16 in public function `is_mapping`:
        D401: First line should be imperative: 'Check', not 'Checks'
./geojson/mapping.py:28 in public function `to_mapping`:
        D103: Docstring missing
./geojson/utils.py:4 in public function `coords`:
        D401: First line should be imperative: 'Yield', not 'Yields'
./geojson/utils.py:4 in public function `coords`:
        D202: No blank lines allowed *after* function docstring, found 1
./geojson/utils.py:28 in public function `map_coords`:
        D401: First line should be imperative: 'Return', not 'Returns'
./geojson/utils.py:28 in public function `map_coords`:
        D205: Blank line missing between one-line summary and description
./geojson/utils.py:28 in public function `map_coords`:
        D400: First line should end with '.', not 'd'
./geojson/utils.py:28 in public function `map_coords`:
        D202: No blank lines allowed *after* function docstring, found 1
./tests/__init__.py:1 at module level:
        D100: Docstring missing
frewsxcv commented 9 years ago

We can tackle that one in a separate issue. Thanks for this @chrisvoncsefalvay!