Skip to content
Merged
Show file tree
Hide file tree
Changes from all commits
Commits
File filter

Filter by extension

Filter by extension


Conversations
Failed to load comments.
Loading
Jump to
Jump to file
Failed to load files.
Loading
Diff view
Diff view
4 changes: 2 additions & 2 deletions .github/workflows/ci.yml
Original file line number Diff line number Diff line change
Expand Up @@ -14,19 +14,19 @@ jobs:
matrix:
python-version:
- "pypy3.9"
- "3.14"
- "3.13"
- "3.12"
- "3.11"
- "3.10"
- "3.9"
os: [ubuntu-latest]
runs-on: ${{ matrix.os }}
name: "${{ matrix.os }} Python: ${{ matrix.python-version }}"
steps:
- name: Setup Python for tox
uses: actions/setup-python@v4
with:
python-version: "3.12"
python-version: "3.13"
- name: Install tox
run: python -m pip install tox tox-gh-actions
- uses: actions/checkout@v3
Expand Down
2 changes: 1 addition & 1 deletion .github/workflows/do-lint.yml
Original file line number Diff line number Diff line change
Expand Up @@ -15,7 +15,7 @@ jobs:
- name: Setup Python for linting
uses: actions/setup-python@v4
with:
python-version: "3.12"
python-version: "3.13"
- name: Install tox
run: python -m pip install tox tox-gh-actions
- uses: actions/checkout@v3
Expand Down
16 changes: 8 additions & 8 deletions .pre-commit-config.yaml
Original file line number Diff line number Diff line change
@@ -1,7 +1,7 @@
exclude: 'tests/'
repos:
- repo: https://github.com/pre-commit/pre-commit-hooks
rev: v5.0.0
rev: v6.0.0
hooks:
- id: check-merge-conflict
- id: check-toml
Expand All @@ -11,28 +11,28 @@ repos:
- id: no-commit-to-branch
- id: trailing-whitespace
- repo: https://github.com/pre-commit/pre-commit
rev: v4.2.0
rev: v4.5.1
hooks:
- id: validate_manifest
- repo: https://github.com/psf/black
rev: '25.1.0'
rev: '26.3.1'
hooks:
- id: black
types_or: [python, pyi]
language_version: python3
- repo: https://github.com/PyCQA/isort
rev: 6.0.1
rev: 8.0.1
hooks:
- id: isort
args: [--settings-file, ./pyproject.toml]
- repo: https://github.com/PyCQA/docformatter
rev: v1.7.7
rev: ab715b8e12b601ba392e7502898e500dde10b4e8
hooks:
- id: docformatter
additional_dependencies: [tomli]
args: [--in-place, --config, ./pyproject.toml]
- repo: https://github.com/charliermarsh/ruff-pre-commit
rev: 'v0.12.4'
rev: 'v0.15.11'
hooks:
- id: ruff
args: [ --config, ./pyproject.toml ]
Expand All @@ -43,13 +43,13 @@ repos:
additional_dependencies: [toml]
args: [--config, ./pyproject.toml]
- repo: https://github.com/pre-commit/mirrors-mypy
rev: v1.17.0
rev: v1.20.1
hooks:
- id: mypy
additional_dependencies: [types-python-dateutil]
args: [--config-file, ./pyproject.toml]
- repo: https://github.com/myint/eradicate
rev: '3.0.0'
rev: '3.0.1'
hooks:
- id: eradicate
args: []
Expand Down
3 changes: 1 addition & 2 deletions docs/source/conf.py
Original file line number Diff line number Diff line change
Expand Up @@ -7,11 +7,10 @@
# https://www.sphinx-doc.org/en/master/usage/configuration.html#project-information
"""Configuration file for the Sphinx documentation builder."""


project = "docformatter"
copyright = "2022-2023, Steven Myint"
author = "Steven Myint"
release = "1.7.7"
release = "1.7.8"

# -- General configuration ---------------------------------------------------
# https://www.sphinx-doc.org/en/master/usage/configuration.html#general-configuration
Expand Down
18 changes: 12 additions & 6 deletions pyproject.toml
Original file line number Diff line number Diff line change
@@ -1,6 +1,6 @@
[tool.poetry]
name = "docformatter"
version = "1.7.7"
version = "1.7.8"
description = "Formats docstrings to follow PEP 257"
authors = ["Steven Myint"]
maintainers = [
Expand All @@ -18,10 +18,11 @@ classifiers=[
'Intended Audience :: Developers',
'Environment :: Console',
'Programming Language :: Python :: 3',
'Programming Language :: Python :: 3.9',
'Programming Language :: Python :: 3.10',
'Programming Language :: Python :: 3.11',
'Programming Language :: Python :: 3.12',
'Programming Language :: Python :: 3.13',
'Programming Language :: Python :: 3.14',
'Programming Language :: Python :: Implementation',
'Programming Language :: Python :: Implementation :: PyPy',
'Programming Language :: Python :: Implementation :: CPython',
Expand All @@ -30,7 +31,7 @@ classifiers=[
packages = [{include = "docformatter", from = "src"}]

[tool.poetry.dependencies]
python = "^3.9"
python = "^3.10"
charset_normalizer = "^3.0.0"
tomli = {version = "^2.0.0", python = "<3.11", optional = true}

Expand Down Expand Up @@ -142,8 +143,13 @@ output = 'coverage.xml'

[tool.black]
line-length = 88
target-version = ['py39', 'py310', 'py311', 'py312', 'py313']
include = '\.pyi?$'
target-version = [
'py310',
'py311',
'py312',
'py313',
'py314',
]
exclude = '''
/(
\.eggs
Expand Down Expand Up @@ -221,7 +227,7 @@ exclude = [
]
line-length = 88
indent-width = 4
target-version = "py39"
target-version = "py310"

[tool.ruff.lint]
select = ["E", "F", "PL"]
Expand Down
1 change: 0 additions & 1 deletion src/docformatter/__init__.py
Original file line number Diff line number Diff line change
Expand Up @@ -26,7 +26,6 @@
# SOFTWARE.
"""This is the docformatter package."""


__all__ = ["__version__"]

# docformatter Local Imports
Expand Down
7 changes: 2 additions & 5 deletions src/docformatter/__main__.py
Original file line number Diff line number Diff line change
Expand Up @@ -26,7 +26,6 @@
# SOFTWARE.
"""Formats docstrings to follow PEP 257."""


# Standard Library Imports
import contextlib
import signal
Expand All @@ -39,8 +38,7 @@

def _help():
"""Print docformatter's help."""
print(
"""\
print("""\
usage: docformatter [-h] [-i | -c] [-d] [-r] [-e [EXCLUDE ...]]
[-n [NON-CAP ...]] [-s [style]] [--rest-section-adorns REGEX]
[--black] [--wrap-summaries length]
Expand Down Expand Up @@ -108,8 +106,7 @@ def _help():
(see issue #67) (default: False)
--config CONFIG path to file containing docformatter options
--version show program's version number and exit
"""
)
""")


def _main(argv, standard_out, standard_error, standard_in):
Expand Down
3 changes: 1 addition & 2 deletions src/docformatter/__pkginfo__.py
Original file line number Diff line number Diff line change
Expand Up @@ -26,5 +26,4 @@
# SOFTWARE.
"""Package information for docformatter."""


__version__ = "1.7.7"
__version__ = "1.7.8"
1 change: 0 additions & 1 deletion src/docformatter/classify.py
Original file line number Diff line number Diff line change
Expand Up @@ -26,7 +26,6 @@
# SOFTWARE.
"""This module provides docformatter's classification functions."""


# Standard Library Imports
import re
import sys
Expand Down
1 change: 0 additions & 1 deletion src/docformatter/configuration.py
Original file line number Diff line number Diff line change
Expand Up @@ -26,7 +26,6 @@
# SOFTWARE.
"""This module provides docformatter's Configurater class."""


# Standard Library Imports
import argparse
import contextlib
Expand Down
6 changes: 3 additions & 3 deletions src/docformatter/constants.py
Original file line number Diff line number Diff line change
Expand Up @@ -26,7 +26,6 @@
# SOFTWARE.
"""This module provides docformatter's constants."""


# TODO: Move these constants to the configuration file and/or command line.
ABBREVIATIONS = (
"e.g.",
Expand Down Expand Up @@ -200,8 +199,9 @@
URL_SKIP_REGEX = rf"({URL_PATTERNS}):(/){{0,2}}(``|')"
"""The regex used to ignore found hyperlinks.

URLs that don't actually contain a domain, but only the URL pattern should
be treated like simple text. This will ignore URLs like ``http://`` or 'ftp:`.
URLs that don't actually contain a domain, but only the URL pattern should be treated
like simple text. This will ignore URLs like ``http://`` or
'ftp:`.

({URL_PATTERNS}) matches one of the URL patterns.
:(/){{0,2}} matches a colon followed by up to two forward slashes.
Expand Down
1 change: 0 additions & 1 deletion src/docformatter/encode.py
Original file line number Diff line number Diff line change
Expand Up @@ -26,7 +26,6 @@
# SOFTWARE.
"""This module provides docformatter's Encoder class."""


# Standard Library Imports
import collections
import locale
Expand Down
1 change: 0 additions & 1 deletion src/docformatter/patterns/__init__.py
Original file line number Diff line number Diff line change
Expand Up @@ -26,7 +26,6 @@
# SOFTWARE.
"""This is the docformatter patterns package."""


# docformatter Local Imports
from .fields import * # noqa F403
from .headers import * # noqa F403
Expand Down
1 change: 0 additions & 1 deletion src/docformatter/patterns/fields.py
Original file line number Diff line number Diff line change
Expand Up @@ -26,7 +26,6 @@
# SOFTWARE.
"""This module provides docformatter's field list pattern recognition functions."""


# Standard Library Imports
import re
from re import Match
Expand Down
1 change: 0 additions & 1 deletion src/docformatter/patterns/headers.py
Original file line number Diff line number Diff line change
Expand Up @@ -26,7 +26,6 @@
# SOFTWARE.
"""This module provides docformatter's header pattern recognition functions."""


# Standard Library Imports
import re
from re import Match
Expand Down
1 change: 0 additions & 1 deletion src/docformatter/patterns/misc.py
Original file line number Diff line number Diff line change
Expand Up @@ -26,7 +26,6 @@
# SOFTWARE.
"""This module provides docformatter's miscellaneous pattern recognition functions."""


# Standard Library Imports
import re
import tokenize
Expand Down
1 change: 0 additions & 1 deletion src/docformatter/patterns/rest.py
Original file line number Diff line number Diff line change
Expand Up @@ -26,7 +26,6 @@
# SOFTWARE.
"""This module provides docformatter's reST directive pattern recognition functions."""


# Standard Library Imports
import re

Expand Down
1 change: 0 additions & 1 deletion src/docformatter/patterns/url.py
Original file line number Diff line number Diff line change
Expand Up @@ -26,7 +26,6 @@
# SOFTWARE.
"""This module provides docformatter's URL pattern recognition functions."""


# Standard Library Imports
import contextlib
import re
Expand Down
1 change: 0 additions & 1 deletion src/docformatter/strings.py
Original file line number Diff line number Diff line change
Expand Up @@ -26,7 +26,6 @@
# SOFTWARE.
"""This module provides docformatter string manipulation functions."""


# Standard Library Imports
import contextlib
import re
Expand Down
1 change: 0 additions & 1 deletion src/docformatter/util.py
Original file line number Diff line number Diff line change
Expand Up @@ -26,7 +26,6 @@
# SOFTWARE.
"""This module provides docformatter utility functions."""


# Standard Library Imports
import os
import re
Expand Down
1 change: 0 additions & 1 deletion src/docformatter/wrappers/__init__.py
Original file line number Diff line number Diff line change
Expand Up @@ -26,7 +26,6 @@
# SOFTWARE.
"""This is the docformatter wrappers package."""


# docformatter Local Imports
from .description import * # noqa F403
from .fields import * # noqa F403
Expand Down
1 change: 0 additions & 1 deletion src/docformatter/wrappers/description.py
Original file line number Diff line number Diff line change
Expand Up @@ -26,7 +26,6 @@
# SOFTWARE.
"""This module provides docformatter's description wrapper functions."""


# Standard Library Imports
import contextlib
from typing import List
Expand Down
1 change: 0 additions & 1 deletion src/docformatter/wrappers/fields.py
Original file line number Diff line number Diff line change
Expand Up @@ -26,7 +26,6 @@
# SOFTWARE.
"""This module provides docformatter's field list wrapper functions."""


# Standard Library Imports
import re
import textwrap
Expand Down
1 change: 0 additions & 1 deletion src/docformatter/wrappers/summary.py
Original file line number Diff line number Diff line change
Expand Up @@ -26,7 +26,6 @@
# SOFTWARE.
"""This module provides docformatter's summary wrapper functions."""


# Standard Library Imports
import re
import textwrap
Expand Down
1 change: 0 additions & 1 deletion src/docformatter/wrappers/url.py
Original file line number Diff line number Diff line change
Expand Up @@ -26,7 +26,6 @@
# SOFTWARE.
"""This module provides docformatter's URL wrapper functions."""


# Standard Library Imports
import contextlib
from typing import Iterable, List, Tuple
Expand Down
11 changes: 5 additions & 6 deletions tox.ini
Original file line number Diff line number Diff line change
@@ -1,10 +1,10 @@
[tox]
env_list =
py39
py310
py311
py312
py313
py314
pypy3
coverage
pre-commit
Expand All @@ -14,12 +14,12 @@ skipsdist = true

[gh-actions]
python =
3.9: py39
3.10: py310
3.11: py311
3.12: py312
3.13: py313
pypy-3.9: pypy3
3.14: py314
pypy-3.11: pypy3

[testenv]
description = Run the test suite using pytest under {basepython}
Expand Down Expand Up @@ -71,7 +71,7 @@ commands =
coverage combine
coverage report -m
coverage xml -o {toxworkdir}/coverage.xml
depends = py39, py310, py311, py312, py313, pypy3
depends = py310, py311, py312, py313, py314, pypy3

[testenv:pre-commit]
description = Run autoformatters and quality assurance tools under {basepython}.
Expand All @@ -87,5 +87,4 @@ commands =
description = build docformatter documentation
allowlist_externals = make
changedir = docs
commands =
make html
commands = make html
Loading