NCAS-CMS / cfunits

A Python interface to UNIDATA’s UDUNITS-2 library with CF extensions:
http://ncas-cms.github.io/cfunits
MIT License
11 stars 8 forks source link

Pre-commit hooks to enforce Google-style docstrings #22

Closed sadielbartholomew closed 3 years ago

sadielbartholomew commented 3 years ago

Set up two new pre-commit hooks to target the formatting and style of the docstrings, namely:

Currently the docstrings across our cf tools libraries are all in Google format, so this is the style that we should run with. The only notable aspect of Google docstrings I have observed we aren't particularly consistent with is that:

The docstring should be descriptive-style ("""Fetches rows from a Bigtable.""") rather than imperative-style ("""Fetch rows from a Bigtable."""), except for @property data descriptors, which should use the same style as attributes

So, though the pydocstyle can't detect this, we should try to consistently be "descriptive" not "imperative", my interpretation of that being to say what the object does rather than what we would ask it to do (if it could do anything we said without us having to code it up).

codecov-io commented 3 years ago

Codecov Report

Merging #22 (d826343) into master (f77b966) will not change coverage. The diff coverage is n/a.

Impacted file tree graph

@@           Coverage Diff           @@
##           master      #22   +/-   ##
=======================================
  Coverage   78.62%   78.62%           
=======================================
  Files           2        2           
  Lines         720      720           
=======================================
  Hits          566      566           
  Misses        154      154           
Flag Coverage Δ
unittests 78.62% <ø> (ø)

Flags with carried forward coverage won't be shown. Click here to find out more.

Impacted Files Coverage Δ
cfunits/__init__.py 77.78% <ø> (ø)
cfunits/units.py 78.64% <ø> (ø)

Continue to review full report at Codecov.

Legend - Click here to learn more Δ = absolute <relative> (impact), ø = not affected, ? = missing data Powered by Codecov. Last update f77b966...d826343. Read the comment docs.