Skip to content

Commit b7a909f

Browse files
Add spell checking and enforce docstrings (#484)
Co-authored-by: pre-commit-ci[bot] <66853113+pre-commit-ci[bot]@users.noreply.github.com>
1 parent 7f079ee commit b7a909f

File tree

17 files changed

+65
-10
lines changed

17 files changed

+65
-10
lines changed

.github/workflows/test.yml

Lines changed: 2 additions & 2 deletions
Original file line numberDiff line numberDiff line change
@@ -24,7 +24,7 @@ jobs:
2424
run: |
2525
hatch run typing:test
2626
hatch run lint:style
27-
pipx run 'validate-pyproject[all]' pyproject.toml
27+
pipx run interrogate -v jupyter_releaser
2828
pipx run doc8 --max-line-length=200
2929
3030
check_links:
@@ -114,7 +114,7 @@ jobs:
114114
hatch run test:nowarn || hatch run test:nowarn --lf
115115
116116
docs:
117-
runs-on: ubuntu-20.04
117+
runs-on: windows-latest
118118
timeout-minutes: 10
119119
steps:
120120
- uses: actions/checkout@v3

.pre-commit-config.yaml

Lines changed: 6 additions & 5 deletions
Original file line numberDiff line numberDiff line change
@@ -5,17 +5,18 @@ repos:
55
- repo: https://github.com/pre-commit/pre-commit-hooks
66
rev: v4.4.0
77
hooks:
8-
- id: end-of-file-fixer
98
- id: check-case-conflict
9+
- id: check-ast
10+
- id: check-docstring-first
1011
- id: check-executables-have-shebangs
11-
- id: requirements-txt-fixer
1212
- id: check-added-large-files
1313
- id: check-case-conflict
14+
- id: check-merge-conflict
15+
- id: check-json
1416
- id: check-toml
1517
- id: check-yaml
1618
- id: debug-statements
17-
- id: forbid-new-submodules
18-
- id: check-builtin-literals
19+
- id: end-of-file-fixer
1920
- id: trailing-whitespace
2021

2122
- repo: https://github.com/python-jsonschema/check-jsonschema
@@ -36,7 +37,7 @@ repos:
3637
- id: black
3738

3839
- repo: https://github.com/charliermarsh/ruff-pre-commit
39-
rev: v0.0.185
40+
rev: v0.0.189
4041
hooks:
4142
- id: ruff
4243
args: ["--fix"]

docs/source/conf.py

Lines changed: 7 additions & 0 deletions
Original file line numberDiff line numberDiff line change
@@ -41,6 +41,13 @@
4141
"sphinx_click",
4242
]
4343

44+
try:
45+
import enchant # type:ignore # noqa
46+
47+
extensions += ["sphinxcontrib.spelling"]
48+
except ImportError:
49+
pass
50+
4451
myst_enable_extensions = ["html_image"]
4552

4653
# Add any paths that contain templates here, relative to this directory.

jupyter_releaser/__main__.py

Lines changed: 1 addition & 0 deletions
Original file line numberDiff line numberDiff line change
@@ -1,3 +1,4 @@
1+
"""The main entry point for Jupyter Releaser."""
12
# Copyright (c) Jupyter Development Team.
23
# Distributed under the terms of the Modified BSD License.
34
from jupyter_releaser.cli import main

jupyter_releaser/actions/common.py

Lines changed: 4 additions & 0 deletions
Original file line numberDiff line numberDiff line change
@@ -1,3 +1,4 @@
1+
"""Common functions for actions."""
12
from contextlib import contextmanager
23

34
from jupyter_releaser.util import prepare_environment
@@ -6,16 +7,19 @@
67

78
@contextmanager
89
def make_group(name):
10+
"""Make a collapsed group in the GitHub Actions log."""
911
print(f"::group::{name}")
1012
yield
1113
print("::endgroup::")
1214

1315

1416
def setup(fetch_draft_release=True):
17+
"""Common setup tasks for actions."""
1518
with make_group("Prepare Environment"):
1619
return prepare_environment(fetch_draft_release=fetch_draft_release)
1720

1821

1922
def run_action(target, *args, **kwargs):
23+
"""Run an action."""
2024
with make_group(target):
2125
_run(target, *args, **kwargs)

jupyter_releaser/actions/finalize_release.py

Lines changed: 1 addition & 0 deletions
Original file line numberDiff line numberDiff line change
@@ -1,3 +1,4 @@
1+
"""Finalize a release."""
12
# Copyright (c) Jupyter Development Team.
23
# Distributed under the terms of the Modified BSD License.
34
import os

jupyter_releaser/actions/generate_changelog.py

Lines changed: 1 addition & 0 deletions
Original file line numberDiff line numberDiff line change
@@ -1,3 +1,4 @@
1+
"""Generate a changelog."""
12
import os
23
from pathlib import Path
34

jupyter_releaser/actions/populate_release.py

Lines changed: 1 addition & 0 deletions
Original file line numberDiff line numberDiff line change
@@ -1,3 +1,4 @@
1+
"""Populate a release."""
12
# Copyright (c) Jupyter Development Team.
23
# Distributed under the terms of the Modified BSD License.
34

jupyter_releaser/actions/prep_release.py

Lines changed: 1 addition & 0 deletions
Original file line numberDiff line numberDiff line change
@@ -1,3 +1,4 @@
1+
"""Prepare a release."""
12
# Copyright (c) Jupyter Development Team.
23
# Distributed under the terms of the Modified BSD License.
34
import os

jupyter_releaser/changelog.py

Lines changed: 2 additions & 0 deletions
Original file line numberDiff line numberDiff line change
@@ -1,3 +1,4 @@
1+
"""Changelog utilities for Jupyter Releaser."""
12
# Copyright (c) Jupyter Development Team.
23
# Distributed under the terms of the Modified BSD License.
34
import re
@@ -177,6 +178,7 @@ def build_entry(
177178

178179

179180
def update_changelog(changelog_path, entry):
181+
"""Update a changelog with a new entry."""
180182
# Get the new version
181183
version = util.get_version()
182184

0 commit comments

Comments
 (0)