Skip to content
Merged
Show file tree
Hide file tree
Changes from all commits
Commits
Show all changes
23 commits
Select commit Hold shift + click to select a range
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
13 changes: 10 additions & 3 deletions .github/workflows/ci.yml
Original file line number Diff line number Diff line change
Expand Up @@ -43,7 +43,7 @@ jobs:
fail-fast: false
matrix:
os: [macos-latest, ubuntu-latest, windows-latest]
python-version: ["3.9", "3.10", "3.11", "3.12", "3.13"]
python-version: ["3.11", "3.12", "3.13"]

steps:
- uses: actions/checkout@11bd71901bbe5b1630ceea73d27597364c9af683 # v4.2.2
Expand All @@ -65,5 +65,12 @@ jobs:
- name: Install dev dependencies
run: python -m pip install --group dev

- name: Validate pre-commit hook
run: pre-commit try-repo . docstringify
- name: Check that the docstringify-edit pre-commit hook is available
run: pre-commit try-repo . docstringify-edit

- name: Check that the docstringify-suggest pre-commit hook is available
run: pre-commit try-repo . docstringify-suggest

# this is the only hook that works without an additional arg so we can test it like this
- name: Validate the docstringify-check pre-commit hook
run: pre-commit try-repo . docstringify-check --all-files
18 changes: 12 additions & 6 deletions .pre-commit-config.yaml
Original file line number Diff line number Diff line change
Expand Up @@ -4,7 +4,7 @@ ci:

repos:
- repo: https://github.com/pre-commit/pre-commit-hooks
rev: v5.0.0
rev: v6.0.0
hooks:
- id: check-toml
- id: check-yaml
Expand All @@ -26,20 +26,26 @@ repos:
exclude: (tests|docs)/.*

- repo: https://github.com/stefmolin/docstringify
rev: 1.0.0
rev: 1decb1a66b512ab792fdc0d190a7ba761b3d70fd
hooks:
- id: docstringify
args: [--make-changes-inplace=numpydoc]
- id: docstringify-edit
name: docstringify source code with numpydoc style
args: [--overwrite, --style=numpydoc]
files: src/.*
- id: docstringify-edit
name: docstringify tests with stubs
args: [--overwrite, --style=stub]
files: tests/.*

- repo: https://github.com/astral-sh/ruff-pre-commit
rev: v0.12.2
rev: v0.14.2
hooks:
- id: ruff-check
args: [--fix, --exit-non-zero-on-fix, --show-fixes]
- id: ruff-format

- repo: https://github.com/tox-dev/pyproject-fmt
rev: v2.6.0
rev: v2.7.0
hooks:
- id: pyproject-fmt
args: [--keep-full-version, --no-print-diff]
34 changes: 31 additions & 3 deletions .pre-commit-hooks.yaml
Original file line number Diff line number Diff line change
@@ -1,7 +1,35 @@
- id: docstringify-edit
name: generate missing docstrings with docstringify
description: >-
Generate missing docstrings from signatures and type annotations,
injecting them into the source code.
entry: docstringify edit
language: python
types: [python]

- id: docstringify-suggest
name: suggest docstrings with docstringify
description: >-
Generate suggestions for missing docstrings from signatures and
type annotations, printing them for inspection.
entry: docstringify suggest
language: python
types: [python]

- id: docstringify-check
name: check for missing docstrings with docstringify
description: >-
Flag missing docstrings, failing if more than the threshold are missing.
entry: docstringify check
language: python
require_serial: true
types: [python]

- id: docstringify
name: docstringify
description: |
Flag missing docstrings and, optionally, generate them from signatures and type annotations.
name: docstringify (deprecated)
description: >-
Flag missing docstrings and, optionally, generate them from signatures
and type annotations.
entry: docstringify
language: python
require_serial: true
Expand Down
5 changes: 2 additions & 3 deletions pyproject.toml
Original file line number Diff line number Diff line change
Expand Up @@ -20,13 +20,11 @@ license-files = [ "LICENSE" ]
authors = [
{ name = "Stefanie Molin", email = "docstringify@stefaniemolin.com" },
]
requires-python = ">=3.9"
requires-python = ">=3.11"
classifiers = [
"Development Status :: 4 - Beta",
"Programming Language :: Python",
"Programming Language :: Python :: 3 :: Only",
"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",
Expand Down Expand Up @@ -85,6 +83,7 @@ lint.isort.known-first-party = [
]

[tool.codespell]
ignore-words-list = "docstringify"
ignore-regex = 'https://([\w/\.])+'

[tool.numpydoc_validation]
Expand Down
Loading
Loading