Skip to content

Commit 898d180

Browse files
authored
Add spelling and docstring enforcement (#1147)
1 parent 66dfa0e commit 898d180

Some content is hidden

Large Commits have some content hidden by default. Use the searchbox below for content that may be hidden.

71 files changed

+444
-37
lines changed

.github/workflows/python-tests.yml

Lines changed: 5 additions & 1 deletion
Original file line numberDiff line numberDiff line change
@@ -57,6 +57,10 @@ jobs:
5757
steps:
5858
- uses: actions/checkout@v3
5959
- uses: jupyterlab/maintainer-tools/.github/actions/base-setup@v1
60+
- name: Install Dependencies
61+
run: |
62+
sudo apt-get update
63+
sudo apt-get install enchant-2 # for spell checking
6064
- run: hatch run docs:build
6165

6266
test_lint:
@@ -69,7 +73,7 @@ jobs:
6973
run: |
7074
hatch run typing:test
7175
hatch run lint:style
72-
pipx run 'validate-pyproject[all]' pyproject.toml
76+
pipx run interrogate -v .
7377
pipx run doc8 --max-line-length=200 --ignore-path=docs/source/other/full-config.rst
7478
npm install -g eslint
7579
eslint .

.pre-commit-config.yaml

Lines changed: 7 additions & 6 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
@@ -29,12 +30,12 @@ repos:
2930
- id: mdformat
3031

3132
- repo: https://github.com/psf/black
32-
rev: 22.10.0
33+
rev: 22.12.0
3334
hooks:
3435
- id: black
3536

3637
- repo: https://github.com/charliermarsh/ruff-pre-commit
37-
rev: v0.0.177
38+
rev: v0.0.194
3839
hooks:
3940
- id: ruff
4041
args: ["--fix"]

docs/source/conf.py

Lines changed: 7 additions & 0 deletions
Original file line numberDiff line numberDiff line change
@@ -84,6 +84,13 @@
8484
"sphinxemoji.sphinxemoji",
8585
]
8686

87+
try:
88+
import enchant # type:ignore # noqa
89+
90+
extensions += ["sphinxcontrib.spelling"]
91+
except ImportError:
92+
pass
93+
8794
myst_enable_extensions = ["html_image"]
8895

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

examples/authorization/jupyter_nbclassic_readonly_config.py

Lines changed: 1 addition & 0 deletions
Original file line numberDiff line numberDiff line change
@@ -1,3 +1,4 @@
1+
"""Nbclassic read only auth example."""
12
from jupyter_server.auth import Authorizer
23

34

examples/authorization/jupyter_nbclassic_rw_config.py

Lines changed: 1 addition & 0 deletions
Original file line numberDiff line numberDiff line change
@@ -1,3 +1,4 @@
1+
"""Nbclassic read/write auth example."""
12
from jupyter_server.auth import Authorizer
23

34

examples/authorization/jupyter_temporary_config.py

Lines changed: 1 addition & 0 deletions
Original file line numberDiff line numberDiff line change
@@ -1,3 +1,4 @@
1+
"""Nbclassic temporary server auth example."""
12
from jupyter_server.auth import Authorizer
23

34

examples/identity/system_password/jupyter_server_config.py

Lines changed: 4 additions & 0 deletions
Original file line numberDiff line numberDiff line change
@@ -1,3 +1,4 @@
1+
"""Jupyter server system password identity provider example."""
12
import pwd
23
from getpass import getuser
34

@@ -7,10 +8,13 @@
78

89

910
class SystemPasswordIdentityProvider(IdentityProvider):
11+
"""A system password identity provider."""
12+
1013
# no need to generate a default token (token can still be used, but it's opt-in)
1114
need_token = False
1215

1316
def process_login_form(self, handler):
17+
"""Process a login form."""
1418
username = getuser()
1519
password = handler.get_argument("password", "")
1620
try:

examples/simple/conftest.py

Lines changed: 1 addition & 0 deletions
Original file line numberDiff line numberDiff line change
@@ -1 +1,2 @@
1+
"""Pytest configurtion."""
12
pytest_plugins = ["jupyter_server.pytest_plugin"]

examples/simple/jupyter_server_config.py

Lines changed: 1 addition & 1 deletion
Original file line numberDiff line numberDiff line change
@@ -1,4 +1,4 @@
1-
# Configuration file for jupyter-server extensions.
1+
"""Configuration file for jupyter-server extensions."""
22
# ------------------------------------------------------------------------------
33
# Application(SingletonConfigurable) configuration
44
# ------------------------------------------------------------------------------
Lines changed: 1 addition & 0 deletions
Original file line numberDiff line numberDiff line change
@@ -1 +1,2 @@
1+
"""Jupyter server config."""
12
c.SimpleApp11.ignore_js = True # type:ignore[name-defined]

0 commit comments

Comments
 (0)