Skip to content

Commit bf8aab2

Browse files
Use ruff docstring-code-format (#1377)
Co-authored-by: pre-commit-ci[bot] <66853113+pre-commit-ci[bot]@users.noreply.github.com>
1 parent b0bbedf commit bf8aab2

File tree

5 files changed

+16
-17
lines changed

5 files changed

+16
-17
lines changed

.pre-commit-config.yaml

Lines changed: 2 additions & 8 deletions
Original file line numberDiff line numberDiff line change
@@ -21,7 +21,7 @@ repos:
2121
- id: trailing-whitespace
2222

2323
- repo: https://github.com/python-jsonschema/check-jsonschema
24-
rev: 0.27.2
24+
rev: 0.27.3
2525
hooks:
2626
- id: check-github-workflows
2727

@@ -38,12 +38,6 @@ repos:
3838
- id: prettier
3939
types_or: [yaml, html, json]
4040

41-
- repo: https://github.com/adamchainz/blacken-docs
42-
rev: "1.16.0"
43-
hooks:
44-
- id: blacken-docs
45-
additional_dependencies: [black==23.7.0]
46-
4741
- repo: https://github.com/codespell-project/codespell
4842
rev: "v2.2.6"
4943
hooks:
@@ -67,7 +61,7 @@ repos:
6761
["traitlets>=5.13", "jupyter_core>=5.5", "jupyter_client>=8.5"]
6862

6963
- repo: https://github.com/astral-sh/ruff-pre-commit
70-
rev: v0.1.6
64+
rev: v0.1.8
7165
hooks:
7266
- id: ruff
7367
types_or: [python, jupyter]

examples/simple/pyproject.toml

Lines changed: 3 additions & 0 deletions
Original file line numberDiff line numberDiff line change
@@ -31,6 +31,9 @@ source = "nodejs"
3131
[tool.hatch.build.targets.wheel.shared-data]
3232
"etc/jupyter/jupyter_server_config.d" = "etc/jupyter/jupyter_server_config.d"
3333

34+
[tool.hatch.build.targets.wheel]
35+
packages = ["simple_ext1", "simple_ext2", "simple_ext11"]
36+
3437
[tool.hatch.build.hooks.jupyter-builder]
3538
dependencies = [
3639
"hatch-jupyter-builder>=0.8.2",

jupyter_server/auth/security.py

Lines changed: 5 additions & 6 deletions
Original file line numberDiff line numberDiff line change
@@ -41,7 +41,7 @@ def passwd(passphrase=None, algorithm="argon2"):
4141
4242
Examples
4343
--------
44-
>>> passwd('mypassword') # doctest: +ELLIPSIS
44+
>>> passwd("mypassword") # doctest: +ELLIPSIS
4545
'argon2:...'
4646
4747
"""
@@ -93,15 +93,14 @@ def passwd_check(hashed_passphrase, passphrase):
9393
9494
Examples
9595
--------
96-
>>> myhash = passwd('mypassword')
97-
>>> passwd_check(myhash, 'mypassword')
96+
>>> myhash = passwd("mypassword")
97+
>>> passwd_check(myhash, "mypassword")
9898
True
9999
100-
>>> passwd_check(myhash, 'otherpassword')
100+
>>> passwd_check(myhash, "otherpassword")
101101
False
102102
103-
>>> passwd_check('sha1:0e112c3ddfce:a68df677475c2b47b6e86d0467eec97ac5f4b85a',
104-
... 'mypassword')
103+
>>> passwd_check("sha1:0e112c3ddfce:a68df677475c2b47b6e86d0467eec97ac5f4b85a", "mypassword")
105104
True
106105
"""
107106
if hashed_passphrase.startswith("argon2:"):

jupyter_server/utils.py

Lines changed: 2 additions & 2 deletions
Original file line numberDiff line numberDiff line change
@@ -344,11 +344,11 @@ def filefind(filename: str, path_dirs: Sequence[str] | str | None = None) -> str
344344
path dirs is given, the filename is tested as is, after running through
345345
:func:`expandvars` and :func:`expanduser`. Thus a simple call::
346346
347-
filefind('myfile.txt')
347+
filefind("myfile.txt")
348348
349349
will find the file in the current working dir, but::
350350
351-
filefind('~/myfile.txt')
351+
filefind("~/myfile.txt")
352352
353353
Will find the file in the users home directory. This function does not
354354
automatically try any paths, such as the cwd or the user's home directory.

pyproject.toml

Lines changed: 4 additions & 1 deletion
Original file line numberDiff line numberDiff line change
@@ -142,6 +142,9 @@ optional-editable-build = true
142142
[tool.ruff]
143143
line-length = 100
144144

145+
[tool.ruff.format]
146+
docstring-code-format = true
147+
145148
[tool.ruff.lint]
146149
select = [
147150
"B", # flake8-bugbear
@@ -295,4 +298,4 @@ exclude = ["docs", "test"]
295298
ignore = ["W002"]
296299

297300
[tool.repo-review]
298-
ignore = ["GH102"]
301+
ignore = ["GH102", "PC111"]

0 commit comments

Comments
 (0)