diff options
Diffstat (limited to 'doc')
-rw-r--r-- | doc/changelog.rst | 2 | ||||
-rw-r--r-- | doc/reference.rst | 15 |
2 files changed, 17 insertions, 0 deletions
diff --git a/doc/changelog.rst b/doc/changelog.rst index d5fa820..40cbc06 100644 --- a/doc/changelog.rst +++ b/doc/changelog.rst @@ -14,6 +14,8 @@ ChangeLog * Add the :meth:`Version.coerce <semantic_version.Version.coerce>` class method to :class:`~semantic_version.Version` class for mapping arbitrary version strings to semver. + * Add the :func:`~semantic_version.validate` method to validate a version + string against the SemVer rules. 2.1.2 (22/05/2012) ------------------ diff --git a/doc/reference.rst b/doc/reference.rst index 66a5f7d..5b8ca3e 100644 --- a/doc/reference.rst +++ b/doc/reference.rst @@ -43,6 +43,21 @@ Module-level functions :rtype: ``bool`` +.. function:: validate(version) + + Check whether a version string complies with the `SemVer`_ rules. + + .. code-block:: pycon + + >>> semantic_version.validate('1.1.1') + True + >>> semantic_version.validate('1.2.3a4') + False + + :param str version: The version string to validate + :rtype: ``bool`` + + Representing a version (the Version class) ------------------------------------------ |