docstringify 0.1.0__tar.gz
This diff represents the content of publicly available package versions that have been released to one of the supported registries. The information contained in this diff is provided for informational purposes only and reflects changes between package versions as they appear in their respective public registries.
- docstringify-0.1.0/.github/dependabot.yml +11 -0
- docstringify-0.1.0/.github/release.yml +5 -0
- docstringify-0.1.0/.github/workflows/ci.yml +64 -0
- docstringify-0.1.0/.github/workflows/pypi-publish.yml +120 -0
- docstringify-0.1.0/.gitignore +174 -0
- docstringify-0.1.0/.pre-commit-config.yaml +25 -0
- docstringify-0.1.0/.pre-commit-hooks.yaml +8 -0
- docstringify-0.1.0/LICENSE +21 -0
- docstringify-0.1.0/PKG-INFO +146 -0
- docstringify-0.1.0/README.md +95 -0
- docstringify-0.1.0/pyproject.toml +95 -0
- docstringify-0.1.0/setup.cfg +4 -0
- docstringify-0.1.0/src/docstringify/__init__.py +6 -0
- docstringify-0.1.0/src/docstringify/__main__.py +5 -0
- docstringify-0.1.0/src/docstringify/cli.py +71 -0
- docstringify-0.1.0/src/docstringify/components.py +22 -0
- docstringify-0.1.0/src/docstringify/converters/__init__.py +1 -0
- docstringify-0.1.0/src/docstringify/converters/base.py +51 -0
- docstringify-0.1.0/src/docstringify/converters/numpydoc.py +47 -0
- docstringify-0.1.0/src/docstringify/visitor.py +196 -0
- docstringify-0.1.0/src/docstringify.egg-info/PKG-INFO +146 -0
- docstringify-0.1.0/src/docstringify.egg-info/SOURCES.txt +24 -0
- docstringify-0.1.0/src/docstringify.egg-info/dependency_links.txt +1 -0
- docstringify-0.1.0/src/docstringify.egg-info/entry_points.txt +2 -0
- docstringify-0.1.0/src/docstringify.egg-info/requires.txt +6 -0
- docstringify-0.1.0/src/docstringify.egg-info/top_level.txt +1 -0
|
@@ -0,0 +1,11 @@
|
|
|
1
|
+
# Dependabot version updates. See docs for configuration options:
|
|
2
|
+
# https://docs.github.com/code-security/dependabot/dependabot-version-updates/configuration-options-for-the-dependabot.yml-file
|
|
3
|
+
|
|
4
|
+
version: 2
|
|
5
|
+
updates:
|
|
6
|
+
|
|
7
|
+
- package-ecosystem: "github-actions"
|
|
8
|
+
directory: "/"
|
|
9
|
+
schedule:
|
|
10
|
+
# Check for updates to GitHub Actions every month
|
|
11
|
+
interval: "monthly"
|
|
@@ -0,0 +1,64 @@
|
|
|
1
|
+
# This workflow builds docstringify on Mac, Linux, and Windows for
|
|
2
|
+
# multiple versions of Python to confirm it can be properly installed.
|
|
3
|
+
#
|
|
4
|
+
# Based on https://github.com/stefmolin/data-morph/blob/main/.github/workflows/ci.yml
|
|
5
|
+
#
|
|
6
|
+
# Author: Stefanie Molin
|
|
7
|
+
|
|
8
|
+
name: CI
|
|
9
|
+
|
|
10
|
+
on:
|
|
11
|
+
push:
|
|
12
|
+
branches: [ "main" ]
|
|
13
|
+
paths:
|
|
14
|
+
- '**'
|
|
15
|
+
- '!.github/**'
|
|
16
|
+
- '.github/workflows/ci.yml'
|
|
17
|
+
tags: [ "v*" ]
|
|
18
|
+
|
|
19
|
+
pull_request:
|
|
20
|
+
paths:
|
|
21
|
+
- '**'
|
|
22
|
+
- '!.github/**'
|
|
23
|
+
- '.github/workflows/ci.yml'
|
|
24
|
+
|
|
25
|
+
concurrency:
|
|
26
|
+
group: ${{ github.workflow }}-${{ github.head_ref || github.run_id }}
|
|
27
|
+
cancel-in-progress: true
|
|
28
|
+
|
|
29
|
+
jobs:
|
|
30
|
+
build:
|
|
31
|
+
name: Build with Python ${{ matrix.python-version }} on ${{ matrix.os }}
|
|
32
|
+
|
|
33
|
+
# The type of runner that the job will run on
|
|
34
|
+
runs-on: ${{ matrix.os }}
|
|
35
|
+
|
|
36
|
+
defaults:
|
|
37
|
+
run:
|
|
38
|
+
shell: bash -e {0}
|
|
39
|
+
|
|
40
|
+
strategy:
|
|
41
|
+
fail-fast: false
|
|
42
|
+
matrix:
|
|
43
|
+
os: [macos-latest, ubuntu-latest, windows-latest]
|
|
44
|
+
python-version: ["3.8", "3.9", "3.10", "3.11", "3.12", "3.13"]
|
|
45
|
+
|
|
46
|
+
steps:
|
|
47
|
+
- uses: actions/checkout@11bd71901bbe5b1630ceea73d27597364c9af683 # v4.2.2
|
|
48
|
+
|
|
49
|
+
- name: Set up Python ${{ matrix.python-version }}
|
|
50
|
+
uses: actions/setup-python@8d9ed9ac5c53483de85588cdf95a591a75ab9f55 # v5.5.0
|
|
51
|
+
with:
|
|
52
|
+
python-version: ${{ matrix.python-version }}
|
|
53
|
+
|
|
54
|
+
- name: Install docstringify
|
|
55
|
+
run: |
|
|
56
|
+
python -m pip install --upgrade pip
|
|
57
|
+
python -m pip install setuptools --upgrade
|
|
58
|
+
python -m pip install .
|
|
59
|
+
|
|
60
|
+
- name: Check entry point
|
|
61
|
+
run: docstringify --version
|
|
62
|
+
|
|
63
|
+
- name: Install testing dependencies
|
|
64
|
+
run: python -m pip install '.[dev]'
|
|
@@ -0,0 +1,120 @@
|
|
|
1
|
+
name: Publish Python 🐍 distribution 📦 to PyPI and TestPyPI
|
|
2
|
+
|
|
3
|
+
on:
|
|
4
|
+
push:
|
|
5
|
+
tags: ["*"]
|
|
6
|
+
|
|
7
|
+
jobs:
|
|
8
|
+
build:
|
|
9
|
+
name: Build distribution 📦
|
|
10
|
+
runs-on: ubuntu-latest
|
|
11
|
+
|
|
12
|
+
steps:
|
|
13
|
+
- uses: actions/checkout@11bd71901bbe5b1630ceea73d27597364c9af683 # v4.2.2
|
|
14
|
+
- name: Set up Python
|
|
15
|
+
uses: actions/setup-python@8d9ed9ac5c53483de85588cdf95a591a75ab9f55 # v5.5.0
|
|
16
|
+
with:
|
|
17
|
+
python-version: "3.x"
|
|
18
|
+
- name: Install pypa/build
|
|
19
|
+
run: >-
|
|
20
|
+
python3 -m
|
|
21
|
+
pip install
|
|
22
|
+
build
|
|
23
|
+
--user
|
|
24
|
+
- name: Build a binary wheel and a source tarball
|
|
25
|
+
run: python3 -m build
|
|
26
|
+
- name: Store the distribution packages
|
|
27
|
+
uses: actions/upload-artifact@ea165f8d65b6e75b540449e92b4886f43607fa02 # v4.6.2
|
|
28
|
+
with:
|
|
29
|
+
name: python-package-distributions
|
|
30
|
+
path: dist/
|
|
31
|
+
|
|
32
|
+
publish-to-pypi:
|
|
33
|
+
name: >-
|
|
34
|
+
Publish Python 🐍 distribution 📦 to PyPI
|
|
35
|
+
if: startsWith(github.ref, 'refs/tags/') && !contains(github.ref, '-rc') # only publish releases to PyPI on tag pushes
|
|
36
|
+
needs:
|
|
37
|
+
- build
|
|
38
|
+
runs-on: ubuntu-latest
|
|
39
|
+
environment:
|
|
40
|
+
name: pypi
|
|
41
|
+
url: https://pypi.org/p/docstringify
|
|
42
|
+
permissions:
|
|
43
|
+
id-token: write # IMPORTANT: mandatory for trusted publishing
|
|
44
|
+
|
|
45
|
+
steps:
|
|
46
|
+
- name: Download all the dists
|
|
47
|
+
uses: actions/download-artifact@95815c38cf2ff2164869cbab79da8d1f422bc89e # v4.2.1
|
|
48
|
+
with:
|
|
49
|
+
name: python-package-distributions
|
|
50
|
+
path: dist/
|
|
51
|
+
- name: Publish distribution 📦 to PyPI
|
|
52
|
+
uses: pypa/gh-action-pypi-publish@76f52bc884231f62b9a034ebfe128415bbaabdfc # v1.12.4
|
|
53
|
+
|
|
54
|
+
github-release:
|
|
55
|
+
name: >-
|
|
56
|
+
Sign the Python 🐍 distribution 📦 with Sigstore
|
|
57
|
+
and upload them to GitHub Release
|
|
58
|
+
needs:
|
|
59
|
+
- publish-to-pypi
|
|
60
|
+
runs-on: ubuntu-latest
|
|
61
|
+
|
|
62
|
+
permissions:
|
|
63
|
+
contents: write # IMPORTANT: mandatory for making GitHub Releases
|
|
64
|
+
id-token: write # IMPORTANT: mandatory for sigstore
|
|
65
|
+
|
|
66
|
+
steps:
|
|
67
|
+
- name: Download all the dists
|
|
68
|
+
uses: actions/download-artifact@95815c38cf2ff2164869cbab79da8d1f422bc89e # v4.2.1
|
|
69
|
+
with:
|
|
70
|
+
name: python-package-distributions
|
|
71
|
+
path: dist/
|
|
72
|
+
- name: Sign the dists with Sigstore
|
|
73
|
+
uses: sigstore/gh-action-sigstore-python@f514d46b907ebcd5bedc05145c03b69c1edd8b46 # v3.0.0
|
|
74
|
+
with:
|
|
75
|
+
inputs: >-
|
|
76
|
+
./dist/*.tar.gz
|
|
77
|
+
./dist/*.whl
|
|
78
|
+
- name: Create GitHub Release
|
|
79
|
+
env:
|
|
80
|
+
GITHUB_TOKEN: ${{ github.token }}
|
|
81
|
+
run: >-
|
|
82
|
+
gh release create
|
|
83
|
+
'${{ github.ref_name }}'
|
|
84
|
+
--repo '${{ github.repository }}'
|
|
85
|
+
--generate-notes
|
|
86
|
+
- name: Upload artifact signatures to GitHub Release
|
|
87
|
+
env:
|
|
88
|
+
GITHUB_TOKEN: ${{ github.token }}
|
|
89
|
+
# Upload to GitHub Release using the `gh` CLI.
|
|
90
|
+
# `dist/` contains the built packages, and the
|
|
91
|
+
# sigstore-produced signatures and certificates.
|
|
92
|
+
run: >-
|
|
93
|
+
gh release upload
|
|
94
|
+
'${{ github.ref_name }}' dist/**
|
|
95
|
+
--repo '${{ github.repository }}'
|
|
96
|
+
|
|
97
|
+
publish-to-testpypi:
|
|
98
|
+
name: Publish Python 🐍 distribution 📦 to TestPyPI
|
|
99
|
+
if: startsWith(github.ref, 'refs/tags/') && contains(github.ref, '-rc') # only publish release candidates to TestPyPI on tag pushes
|
|
100
|
+
needs:
|
|
101
|
+
- build
|
|
102
|
+
runs-on: ubuntu-latest
|
|
103
|
+
|
|
104
|
+
environment:
|
|
105
|
+
name: testpypi
|
|
106
|
+
url: https://test.pypi.org/p/docstringify
|
|
107
|
+
|
|
108
|
+
permissions:
|
|
109
|
+
id-token: write # IMPORTANT: mandatory for trusted publishing
|
|
110
|
+
|
|
111
|
+
steps:
|
|
112
|
+
- name: Download all the dists
|
|
113
|
+
uses: actions/download-artifact@95815c38cf2ff2164869cbab79da8d1f422bc89e # v4.2.1
|
|
114
|
+
with:
|
|
115
|
+
name: python-package-distributions
|
|
116
|
+
path: dist/
|
|
117
|
+
- name: Publish distribution 📦 to TestPyPI
|
|
118
|
+
uses: pypa/gh-action-pypi-publish@76f52bc884231f62b9a034ebfe128415bbaabdfc # v1.12.4
|
|
119
|
+
with:
|
|
120
|
+
repository-url: https://test.pypi.org/legacy/
|
|
@@ -0,0 +1,174 @@
|
|
|
1
|
+
# Byte-compiled / optimized / DLL files
|
|
2
|
+
__pycache__/
|
|
3
|
+
*.py[cod]
|
|
4
|
+
*$py.class
|
|
5
|
+
|
|
6
|
+
# C extensions
|
|
7
|
+
*.so
|
|
8
|
+
|
|
9
|
+
# Distribution / packaging
|
|
10
|
+
.Python
|
|
11
|
+
build/
|
|
12
|
+
develop-eggs/
|
|
13
|
+
dist/
|
|
14
|
+
downloads/
|
|
15
|
+
eggs/
|
|
16
|
+
.eggs/
|
|
17
|
+
lib/
|
|
18
|
+
lib64/
|
|
19
|
+
parts/
|
|
20
|
+
sdist/
|
|
21
|
+
var/
|
|
22
|
+
wheels/
|
|
23
|
+
share/python-wheels/
|
|
24
|
+
*.egg-info/
|
|
25
|
+
.installed.cfg
|
|
26
|
+
*.egg
|
|
27
|
+
MANIFEST
|
|
28
|
+
|
|
29
|
+
# PyInstaller
|
|
30
|
+
# Usually these files are written by a python script from a template
|
|
31
|
+
# before PyInstaller builds the exe, so as to inject date/other infos into it.
|
|
32
|
+
*.manifest
|
|
33
|
+
*.spec
|
|
34
|
+
|
|
35
|
+
# Installer logs
|
|
36
|
+
pip-log.txt
|
|
37
|
+
pip-delete-this-directory.txt
|
|
38
|
+
|
|
39
|
+
# Unit test / coverage reports
|
|
40
|
+
htmlcov/
|
|
41
|
+
.tox/
|
|
42
|
+
.nox/
|
|
43
|
+
.coverage
|
|
44
|
+
.coverage.*
|
|
45
|
+
.cache
|
|
46
|
+
nosetests.xml
|
|
47
|
+
coverage.xml
|
|
48
|
+
*.cover
|
|
49
|
+
*.py,cover
|
|
50
|
+
.hypothesis/
|
|
51
|
+
.pytest_cache/
|
|
52
|
+
cover/
|
|
53
|
+
|
|
54
|
+
# Translations
|
|
55
|
+
*.mo
|
|
56
|
+
*.pot
|
|
57
|
+
|
|
58
|
+
# Django stuff:
|
|
59
|
+
*.log
|
|
60
|
+
local_settings.py
|
|
61
|
+
db.sqlite3
|
|
62
|
+
db.sqlite3-journal
|
|
63
|
+
|
|
64
|
+
# Flask stuff:
|
|
65
|
+
instance/
|
|
66
|
+
.webassets-cache
|
|
67
|
+
|
|
68
|
+
# Scrapy stuff:
|
|
69
|
+
.scrapy
|
|
70
|
+
|
|
71
|
+
# Sphinx documentation
|
|
72
|
+
docs/_build/
|
|
73
|
+
|
|
74
|
+
# PyBuilder
|
|
75
|
+
.pybuilder/
|
|
76
|
+
target/
|
|
77
|
+
|
|
78
|
+
# Jupyter Notebook
|
|
79
|
+
.ipynb_checkpoints
|
|
80
|
+
|
|
81
|
+
# IPython
|
|
82
|
+
profile_default/
|
|
83
|
+
ipython_config.py
|
|
84
|
+
|
|
85
|
+
# pyenv
|
|
86
|
+
# For a library or package, you might want to ignore these files since the code is
|
|
87
|
+
# intended to run in multiple environments; otherwise, check them in:
|
|
88
|
+
# .python-version
|
|
89
|
+
|
|
90
|
+
# pipenv
|
|
91
|
+
# According to pypa/pipenv#598, it is recommended to include Pipfile.lock in version control.
|
|
92
|
+
# However, in case of collaboration, if having platform-specific dependencies or dependencies
|
|
93
|
+
# having no cross-platform support, pipenv may install dependencies that don't work, or not
|
|
94
|
+
# install all needed dependencies.
|
|
95
|
+
#Pipfile.lock
|
|
96
|
+
|
|
97
|
+
# UV
|
|
98
|
+
# Similar to Pipfile.lock, it is generally recommended to include uv.lock in version control.
|
|
99
|
+
# This is especially recommended for binary packages to ensure reproducibility, and is more
|
|
100
|
+
# commonly ignored for libraries.
|
|
101
|
+
#uv.lock
|
|
102
|
+
|
|
103
|
+
# poetry
|
|
104
|
+
# Similar to Pipfile.lock, it is generally recommended to include poetry.lock in version control.
|
|
105
|
+
# This is especially recommended for binary packages to ensure reproducibility, and is more
|
|
106
|
+
# commonly ignored for libraries.
|
|
107
|
+
# https://python-poetry.org/docs/basic-usage/#commit-your-poetrylock-file-to-version-control
|
|
108
|
+
#poetry.lock
|
|
109
|
+
|
|
110
|
+
# pdm
|
|
111
|
+
# Similar to Pipfile.lock, it is generally recommended to include pdm.lock in version control.
|
|
112
|
+
#pdm.lock
|
|
113
|
+
# pdm stores project-wide configurations in .pdm.toml, but it is recommended to not include it
|
|
114
|
+
# in version control.
|
|
115
|
+
# https://pdm.fming.dev/latest/usage/project/#working-with-version-control
|
|
116
|
+
.pdm.toml
|
|
117
|
+
.pdm-python
|
|
118
|
+
.pdm-build/
|
|
119
|
+
|
|
120
|
+
# PEP 582; used by e.g. github.com/David-OConnor/pyflow and github.com/pdm-project/pdm
|
|
121
|
+
__pypackages__/
|
|
122
|
+
|
|
123
|
+
# Celery stuff
|
|
124
|
+
celerybeat-schedule
|
|
125
|
+
celerybeat.pid
|
|
126
|
+
|
|
127
|
+
# SageMath parsed files
|
|
128
|
+
*.sage.py
|
|
129
|
+
|
|
130
|
+
# Environments
|
|
131
|
+
.env
|
|
132
|
+
.venv
|
|
133
|
+
env/
|
|
134
|
+
venv/
|
|
135
|
+
ENV/
|
|
136
|
+
env.bak/
|
|
137
|
+
venv.bak/
|
|
138
|
+
|
|
139
|
+
# Spyder project settings
|
|
140
|
+
.spyderproject
|
|
141
|
+
.spyproject
|
|
142
|
+
|
|
143
|
+
# Rope project settings
|
|
144
|
+
.ropeproject
|
|
145
|
+
|
|
146
|
+
# mkdocs documentation
|
|
147
|
+
/site
|
|
148
|
+
|
|
149
|
+
# mypy
|
|
150
|
+
.mypy_cache/
|
|
151
|
+
.dmypy.json
|
|
152
|
+
dmypy.json
|
|
153
|
+
|
|
154
|
+
# Pyre type checker
|
|
155
|
+
.pyre/
|
|
156
|
+
|
|
157
|
+
# pytype static type analyzer
|
|
158
|
+
.pytype/
|
|
159
|
+
|
|
160
|
+
# Cython debug symbols
|
|
161
|
+
cython_debug/
|
|
162
|
+
|
|
163
|
+
# PyCharm
|
|
164
|
+
# JetBrains specific template is maintained in a separate JetBrains.gitignore that can
|
|
165
|
+
# be found at https://github.com/github/gitignore/blob/main/Global/JetBrains.gitignore
|
|
166
|
+
# and can be added to the global gitignore or merged into this file. For a more nuclear
|
|
167
|
+
# option (not recommended) you can uncomment the following to ignore the entire idea folder.
|
|
168
|
+
#.idea/
|
|
169
|
+
|
|
170
|
+
# Ruff stuff:
|
|
171
|
+
.ruff_cache/
|
|
172
|
+
|
|
173
|
+
# PyPI configuration file
|
|
174
|
+
.pypirc
|
|
@@ -0,0 +1,25 @@
|
|
|
1
|
+
ci:
|
|
2
|
+
autofix_prs: false
|
|
3
|
+
autoupdate_schedule: quarterly
|
|
4
|
+
|
|
5
|
+
repos:
|
|
6
|
+
- repo: https://github.com/pre-commit/pre-commit-hooks
|
|
7
|
+
rev: v5.0.0
|
|
8
|
+
hooks:
|
|
9
|
+
- id: check-toml
|
|
10
|
+
- id: check-yaml
|
|
11
|
+
- id: end-of-file-fixer
|
|
12
|
+
- id: trailing-whitespace
|
|
13
|
+
|
|
14
|
+
- repo: https://github.com/astral-sh/ruff-pre-commit
|
|
15
|
+
rev: v0.11.2
|
|
16
|
+
hooks:
|
|
17
|
+
- id: ruff
|
|
18
|
+
args: [--fix, --exit-non-zero-on-fix, --show-fixes]
|
|
19
|
+
- id: ruff-format
|
|
20
|
+
|
|
21
|
+
- repo: https://github.com/tox-dev/pyproject-fmt
|
|
22
|
+
rev: v2.5.1
|
|
23
|
+
hooks:
|
|
24
|
+
- id: pyproject-fmt
|
|
25
|
+
args: [--keep-full-version, --no-print-diff]
|
|
@@ -0,0 +1,21 @@
|
|
|
1
|
+
MIT License
|
|
2
|
+
|
|
3
|
+
Copyright (c) 2025 Stefanie Molin
|
|
4
|
+
|
|
5
|
+
Permission is hereby granted, free of charge, to any person obtaining a copy
|
|
6
|
+
of this software and associated documentation files (the "Software"), to deal
|
|
7
|
+
in the Software without restriction, including without limitation the rights
|
|
8
|
+
to use, copy, modify, merge, publish, distribute, sublicense, and/or sell
|
|
9
|
+
copies of the Software, and to permit persons to whom the Software is
|
|
10
|
+
furnished to do so, subject to the following conditions:
|
|
11
|
+
|
|
12
|
+
The above copyright notice and this permission notice shall be included in all
|
|
13
|
+
copies or substantial portions of the Software.
|
|
14
|
+
|
|
15
|
+
THE SOFTWARE IS PROVIDED "AS IS", WITHOUT WARRANTY OF ANY KIND, EXPRESS OR
|
|
16
|
+
IMPLIED, INCLUDING BUT NOT LIMITED TO THE WARRANTIES OF MERCHANTABILITY,
|
|
17
|
+
FITNESS FOR A PARTICULAR PURPOSE AND NONINFRINGEMENT. IN NO EVENT SHALL THE
|
|
18
|
+
AUTHORS OR COPYRIGHT HOLDERS BE LIABLE FOR ANY CLAIM, DAMAGES OR OTHER
|
|
19
|
+
LIABILITY, WHETHER IN AN ACTION OF CONTRACT, TORT OR OTHERWISE, ARISING FROM,
|
|
20
|
+
OUT OF OR IN CONNECTION WITH THE SOFTWARE OR THE USE OR OTHER DEALINGS IN THE
|
|
21
|
+
SOFTWARE.
|
|
@@ -0,0 +1,146 @@
|
|
|
1
|
+
Metadata-Version: 2.4
|
|
2
|
+
Name: docstringify
|
|
3
|
+
Version: 0.1.0
|
|
4
|
+
Summary: Flag missing docstrings and, optionally, generate them from signatures and type annotations.
|
|
5
|
+
Author-email: Stefanie Molin <docstringify@stefaniemolin.com>
|
|
6
|
+
License: MIT License
|
|
7
|
+
|
|
8
|
+
Copyright (c) 2025 Stefanie Molin
|
|
9
|
+
|
|
10
|
+
Permission is hereby granted, free of charge, to any person obtaining a copy
|
|
11
|
+
of this software and associated documentation files (the "Software"), to deal
|
|
12
|
+
in the Software without restriction, including without limitation the rights
|
|
13
|
+
to use, copy, modify, merge, publish, distribute, sublicense, and/or sell
|
|
14
|
+
copies of the Software, and to permit persons to whom the Software is
|
|
15
|
+
furnished to do so, subject to the following conditions:
|
|
16
|
+
|
|
17
|
+
The above copyright notice and this permission notice shall be included in all
|
|
18
|
+
copies or substantial portions of the Software.
|
|
19
|
+
|
|
20
|
+
THE SOFTWARE IS PROVIDED "AS IS", WITHOUT WARRANTY OF ANY KIND, EXPRESS OR
|
|
21
|
+
IMPLIED, INCLUDING BUT NOT LIMITED TO THE WARRANTIES OF MERCHANTABILITY,
|
|
22
|
+
FITNESS FOR A PARTICULAR PURPOSE AND NONINFRINGEMENT. IN NO EVENT SHALL THE
|
|
23
|
+
AUTHORS OR COPYRIGHT HOLDERS BE LIABLE FOR ANY CLAIM, DAMAGES OR OTHER
|
|
24
|
+
LIABILITY, WHETHER IN AN ACTION OF CONTRACT, TORT OR OTHERWISE, ARISING FROM,
|
|
25
|
+
OUT OF OR IN CONNECTION WITH THE SOFTWARE OR THE USE OR OTHER DEALINGS IN THE
|
|
26
|
+
SOFTWARE.
|
|
27
|
+
|
|
28
|
+
Project-URL: Documentation, https://github.com/stefmolin/docstringify
|
|
29
|
+
Project-URL: Homepage, https://github.com/stefmolin/docstringify
|
|
30
|
+
Project-URL: Source, https://github.com/stefmolin/docstringify
|
|
31
|
+
Keywords: ast,docstring generation,numpydoc-style docstring,pre-commit
|
|
32
|
+
Classifier: Development Status :: 2 - Pre-Alpha
|
|
33
|
+
Classifier: License :: OSI Approved :: Apache Software License
|
|
34
|
+
Classifier: Programming Language :: Python
|
|
35
|
+
Classifier: Programming Language :: Python :: 3 :: Only
|
|
36
|
+
Classifier: Programming Language :: Python :: 3.8
|
|
37
|
+
Classifier: Programming Language :: Python :: 3.9
|
|
38
|
+
Classifier: Programming Language :: Python :: 3.10
|
|
39
|
+
Classifier: Programming Language :: Python :: 3.11
|
|
40
|
+
Classifier: Programming Language :: Python :: 3.12
|
|
41
|
+
Classifier: Programming Language :: Python :: 3.13
|
|
42
|
+
Requires-Python: >=3.8
|
|
43
|
+
Description-Content-Type: text/markdown
|
|
44
|
+
License-File: LICENSE
|
|
45
|
+
Provides-Extra: dev
|
|
46
|
+
Requires-Dist: pre-commit; extra == "dev"
|
|
47
|
+
Requires-Dist: pytest; extra == "dev"
|
|
48
|
+
Requires-Dist: pytest-cov; extra == "dev"
|
|
49
|
+
Requires-Dist: pytest-randomly; extra == "dev"
|
|
50
|
+
Dynamic: license-file
|
|
51
|
+
|
|
52
|
+
# docstringify
|
|
53
|
+
Flag missing docstrings and, optionally, generate them from signatures and type annotations.
|
|
54
|
+
|
|
55
|
+
## Usage
|
|
56
|
+
|
|
57
|
+
### Pre-commit hook
|
|
58
|
+
|
|
59
|
+
Add the following to your `.pre-commit-config.yaml` file to block commits with missing docstrings:
|
|
60
|
+
|
|
61
|
+
```yaml
|
|
62
|
+
- repo: https://github.com/stefmolin/docstringify
|
|
63
|
+
rev: 0.1.0
|
|
64
|
+
hooks:
|
|
65
|
+
- id: docstringify
|
|
66
|
+
```
|
|
67
|
+
|
|
68
|
+
By default, all docstrings are required. If you want to be more lenient, you can set the threshold, which is the percentage of docstrings that must be present:
|
|
69
|
+
|
|
70
|
+
```yaml
|
|
71
|
+
- repo: https://github.com/stefmolin/docstringify
|
|
72
|
+
rev: 0.1.0
|
|
73
|
+
hooks:
|
|
74
|
+
- id: docstringify
|
|
75
|
+
args: [--threshold=0.75]
|
|
76
|
+
```
|
|
77
|
+
|
|
78
|
+
If you would like to see suggested docstring templates (inferred from type annotations for functions and methods), provide the `--suggest-changes` argument. By default, these will be [numpydoc-style docstrings](https://numpydoc.readthedocs.io/en/latest/format.html#); support for Google-style docstrings will come in a future release:
|
|
79
|
+
|
|
80
|
+
```yaml
|
|
81
|
+
- repo: https://github.com/stefmolin/docstringify
|
|
82
|
+
rev: 0.1.0
|
|
83
|
+
hooks:
|
|
84
|
+
- id: docstringify
|
|
85
|
+
args: [--suggest-changes]
|
|
86
|
+
```
|
|
87
|
+
|
|
88
|
+
Be sure to check out the [pre-commit documentation](https://pre-commit.com/#pre-commit-configyaml---hooks) for additional configuration options.
|
|
89
|
+
|
|
90
|
+
### Command line
|
|
91
|
+
|
|
92
|
+
First, install the `docstringify` package from PyPI:
|
|
93
|
+
|
|
94
|
+
```shell
|
|
95
|
+
$ python -m pip install docstringify
|
|
96
|
+
```
|
|
97
|
+
|
|
98
|
+
Then, use the `docstringify` entry point on the file(s) of your choice:
|
|
99
|
+
|
|
100
|
+
```shell
|
|
101
|
+
$ docstringify /path/to/file [/path/to/another/file]
|
|
102
|
+
```
|
|
103
|
+
|
|
104
|
+
Run `docstringify --help` for more information.
|
|
105
|
+
|
|
106
|
+
### Python
|
|
107
|
+
|
|
108
|
+
First, install the `docstringify` package from PyPI:
|
|
109
|
+
|
|
110
|
+
```shell
|
|
111
|
+
$ python -m pip install docstringify
|
|
112
|
+
```
|
|
113
|
+
|
|
114
|
+
Then, use the `DocstringVisitor()` class on individual files to see spots where docstrings are missing:
|
|
115
|
+
|
|
116
|
+
```pycon
|
|
117
|
+
>>> from docstringify.visitor import DocstringVisitor
|
|
118
|
+
>>> visitor = DocstringVisitor('test.py')
|
|
119
|
+
>>> visitor.process_file()
|
|
120
|
+
test is missing a docstring
|
|
121
|
+
test.say_hello is missing a docstring
|
|
122
|
+
```
|
|
123
|
+
|
|
124
|
+
If you would like to see suggested docstring templates (inferred from type annotations for functions and methods), provide a converter:
|
|
125
|
+
|
|
126
|
+
```pycon
|
|
127
|
+
>>> from docstringify.converters.numpydoc import NumpydocDocstringConverter
|
|
128
|
+
>>> from docstringify.visitor import DocstringVisitor
|
|
129
|
+
>>> visitor = DocstringVisitor('test.py', converter=NumpydocDocstringConverter())
|
|
130
|
+
>>> visitor.process_file()
|
|
131
|
+
test is missing a docstring
|
|
132
|
+
Hint:
|
|
133
|
+
"""__description__"""
|
|
134
|
+
|
|
135
|
+
test.say_hello is missing a docstring
|
|
136
|
+
Hint:
|
|
137
|
+
"""
|
|
138
|
+
__description__
|
|
139
|
+
|
|
140
|
+
Parameters
|
|
141
|
+
----------
|
|
142
|
+
name : str, default="World"
|
|
143
|
+
__description__
|
|
144
|
+
"""
|
|
145
|
+
|
|
146
|
+
```
|
|
@@ -0,0 +1,95 @@
|
|
|
1
|
+
# docstringify
|
|
2
|
+
Flag missing docstrings and, optionally, generate them from signatures and type annotations.
|
|
3
|
+
|
|
4
|
+
## Usage
|
|
5
|
+
|
|
6
|
+
### Pre-commit hook
|
|
7
|
+
|
|
8
|
+
Add the following to your `.pre-commit-config.yaml` file to block commits with missing docstrings:
|
|
9
|
+
|
|
10
|
+
```yaml
|
|
11
|
+
- repo: https://github.com/stefmolin/docstringify
|
|
12
|
+
rev: 0.1.0
|
|
13
|
+
hooks:
|
|
14
|
+
- id: docstringify
|
|
15
|
+
```
|
|
16
|
+
|
|
17
|
+
By default, all docstrings are required. If you want to be more lenient, you can set the threshold, which is the percentage of docstrings that must be present:
|
|
18
|
+
|
|
19
|
+
```yaml
|
|
20
|
+
- repo: https://github.com/stefmolin/docstringify
|
|
21
|
+
rev: 0.1.0
|
|
22
|
+
hooks:
|
|
23
|
+
- id: docstringify
|
|
24
|
+
args: [--threshold=0.75]
|
|
25
|
+
```
|
|
26
|
+
|
|
27
|
+
If you would like to see suggested docstring templates (inferred from type annotations for functions and methods), provide the `--suggest-changes` argument. By default, these will be [numpydoc-style docstrings](https://numpydoc.readthedocs.io/en/latest/format.html#); support for Google-style docstrings will come in a future release:
|
|
28
|
+
|
|
29
|
+
```yaml
|
|
30
|
+
- repo: https://github.com/stefmolin/docstringify
|
|
31
|
+
rev: 0.1.0
|
|
32
|
+
hooks:
|
|
33
|
+
- id: docstringify
|
|
34
|
+
args: [--suggest-changes]
|
|
35
|
+
```
|
|
36
|
+
|
|
37
|
+
Be sure to check out the [pre-commit documentation](https://pre-commit.com/#pre-commit-configyaml---hooks) for additional configuration options.
|
|
38
|
+
|
|
39
|
+
### Command line
|
|
40
|
+
|
|
41
|
+
First, install the `docstringify` package from PyPI:
|
|
42
|
+
|
|
43
|
+
```shell
|
|
44
|
+
$ python -m pip install docstringify
|
|
45
|
+
```
|
|
46
|
+
|
|
47
|
+
Then, use the `docstringify` entry point on the file(s) of your choice:
|
|
48
|
+
|
|
49
|
+
```shell
|
|
50
|
+
$ docstringify /path/to/file [/path/to/another/file]
|
|
51
|
+
```
|
|
52
|
+
|
|
53
|
+
Run `docstringify --help` for more information.
|
|
54
|
+
|
|
55
|
+
### Python
|
|
56
|
+
|
|
57
|
+
First, install the `docstringify` package from PyPI:
|
|
58
|
+
|
|
59
|
+
```shell
|
|
60
|
+
$ python -m pip install docstringify
|
|
61
|
+
```
|
|
62
|
+
|
|
63
|
+
Then, use the `DocstringVisitor()` class on individual files to see spots where docstrings are missing:
|
|
64
|
+
|
|
65
|
+
```pycon
|
|
66
|
+
>>> from docstringify.visitor import DocstringVisitor
|
|
67
|
+
>>> visitor = DocstringVisitor('test.py')
|
|
68
|
+
>>> visitor.process_file()
|
|
69
|
+
test is missing a docstring
|
|
70
|
+
test.say_hello is missing a docstring
|
|
71
|
+
```
|
|
72
|
+
|
|
73
|
+
If you would like to see suggested docstring templates (inferred from type annotations for functions and methods), provide a converter:
|
|
74
|
+
|
|
75
|
+
```pycon
|
|
76
|
+
>>> from docstringify.converters.numpydoc import NumpydocDocstringConverter
|
|
77
|
+
>>> from docstringify.visitor import DocstringVisitor
|
|
78
|
+
>>> visitor = DocstringVisitor('test.py', converter=NumpydocDocstringConverter())
|
|
79
|
+
>>> visitor.process_file()
|
|
80
|
+
test is missing a docstring
|
|
81
|
+
Hint:
|
|
82
|
+
"""__description__"""
|
|
83
|
+
|
|
84
|
+
test.say_hello is missing a docstring
|
|
85
|
+
Hint:
|
|
86
|
+
"""
|
|
87
|
+
__description__
|
|
88
|
+
|
|
89
|
+
Parameters
|
|
90
|
+
----------
|
|
91
|
+
name : str, default="World"
|
|
92
|
+
__description__
|
|
93
|
+
"""
|
|
94
|
+
|
|
95
|
+
```
|