diff --git a/devel/Makefile b/devel/Makefile index a97496f92cab..cfe4cab123c3 100644 --- a/devel/Makefile +++ b/devel/Makefile @@ -4574,6 +4574,7 @@ SUBDIR += py-dj42-django-rq SUBDIR += py-dj42-graphene-django SUBDIR += py-django-rq + SUBDIR += py-docformatter SUBDIR += py-dockerpty SUBDIR += py-docopt SUBDIR += py-doctest-ignore-unicode diff --git a/devel/py-docformatter/Makefile b/devel/py-docformatter/Makefile new file mode 100644 index 000000000000..4f11b9e5460b --- /dev/null +++ b/devel/py-docformatter/Makefile @@ -0,0 +1,36 @@ +PORTNAME= docformatter +PORTVERSION= 1.7.5 +CATEGORIES= devel python +MASTER_SITES= PYPI +PKGNAMEPREFIX= ${PYTHON_PKGNAMEPREFIX} + +MAINTAINER= sunpoet@FreeBSD.org +COMMENT= Format docstrings to follow PEP 257 +WWW= https://docformatter.readthedocs.io/en/latest/ \ + https://github.com/PyCQA/docformatter + +LICENSE= MIT +LICENSE_FILE= ${WRKSRC}/LICENSE + +BUILD_DEPENDS= ${PYTHON_PKGNAMEPREFIX}poetry-core>=1.0.0:devel/py-poetry-core@${PY_FLAVOR} +RUN_DEPENDS= ${PYTHON_PKGNAMEPREFIX}charset-normalizer>=3.0.0<4:textproc/py-charset-normalizer@${PY_FLAVOR} \ + ${PYTHON_PKGNAMEPREFIX}untokenize>=0.1.1<0.2:devel/py-untokenize@${PY_FLAVOR} + +USES= python shebangfix +USE_PYTHON= autoplist concurrent pep517 + +NO_ARCH= yes + +SHEBANG_FILES= src/docformatter/__main__.py + +OPTIONS_DEFINE= TOMLI +OPTIONS_DEFAULT=TOMLI +TOMLI_DESC= TOML (Tom's Obvious Minimal Language) support + +.include + +.if ${PORT_OPTIONS:MTOMLI} && ${PYTHON_REL} < 31100 +RUN_DEPENDS+= ${PYTHON_PKGNAMEPREFIX}tomli>=2.0.0<3:textproc/py-tomli@${PY_FLAVOR} +.endif + +.include diff --git a/devel/py-docformatter/distinfo b/devel/py-docformatter/distinfo new file mode 100644 index 000000000000..eca1c0c85b69 --- /dev/null +++ b/devel/py-docformatter/distinfo @@ -0,0 +1,3 @@ +TIMESTAMP = 1701083330 +SHA256 (docformatter-1.7.5.tar.gz) = ffed3da0daffa2e77f80ccba4f0e50bfa2755e1c10e130102571c890a61b246e +SIZE (docformatter-1.7.5.tar.gz) = 25893 diff --git a/devel/py-docformatter/pkg-descr b/devel/py-docformatter/pkg-descr new file mode 100644 index 000000000000..e852b01270d0 --- /dev/null +++ b/devel/py-docformatter/pkg-descr @@ -0,0 +1,18 @@ +docformatter automatically formats docstrings to follow a subset of the PEP 257 +conventions. Below are the relevant items quoted from PEP 257. +- For consistency, always use triple double quotes around docstrings. +- Triple quotes are used even though the string fits on one line. +- Multi-line docstrings consist of a summary line just like a one-line + docstring, followed by a blank line, followed by a more elaborate description. +- Unless the entire docstring fits on a line, place the closing quotes on a line + by themselves. + +docformatter also handles some of the PEP 8 conventions. +- Don't write string literals that rely on significant trailing whitespace. Such + trailing whitespace is visually indistinguishable and some editors (or more + recently, reindent.py) will trim them. + +docformatter formats docstrings compatible with black when passed the --black +option. + +docformatter formats field lists that use Epytext or Sphinx styles.