Skip to content

Commit

Permalink
clean up lint
Browse files Browse the repository at this point in the history
  • Loading branch information
blink1073 committed Dec 26, 2022
1 parent bf125ed commit 0348c26
Show file tree
Hide file tree
Showing 3 changed files with 10 additions and 9 deletions.
2 changes: 1 addition & 1 deletion .pre-commit-config.yaml
Original file line number Diff line number Diff line change
Expand Up @@ -30,7 +30,7 @@ repos:
- id: mdformat

- repo: https://github.com/psf/black
rev: 22.10.0
rev: 22.12.0
hooks:
- id: black

Expand Down
14 changes: 7 additions & 7 deletions pyproject.toml
Original file line number Diff line number Diff line change
Expand Up @@ -52,11 +52,6 @@ server = [
test = [
"pytest-timeout"
]
lint = [
"black[jupyter]==22.10.0",
"mdformat>0.7",
"ruff==0.0.194",
]
typing = [
"mypy>=0.990"
]
Expand Down Expand Up @@ -102,7 +97,12 @@ dependencies = ["mypy>=0.990"]
test = "mypy --install-types --non-interactive {args:.}"

[tool.hatch.envs.lint]
features = ["lint"]
dependencies = [
"black[jupyter]==22.12.0",
"mdformat>0.7",
"ruff==0.0.194",
]
detached = true
[tool.hatch.envs.lint.scripts]
style = [
"ruff {args:.}",
Expand Down Expand Up @@ -168,7 +168,7 @@ target-version = ["py38"]
target-version = "py38"
line-length = 100
select = [
"A", "B", "C", "E", "F", "FBT", "I", "N", "Q", "RUF", "S", "T",
"A", "B", "C", "E", "EM", "F", "FBT", "I", "N", "Q", "RUF", "S", "T",
"UP", "W", "YTT",
]
ignore = [
Expand Down
3 changes: 2 additions & 1 deletion pytest_jupyter/jupyter_server.py
Original file line number Diff line number Diff line change
Expand Up @@ -372,7 +372,8 @@ def inner(nbpath):
nbpath = jp_root_dir.joinpath(nbpath)
# Check that the notebook has the correct file extension.
if nbpath.suffix != ".ipynb":
raise Exception("File extension for notebook must be .ipynb")
msg = "File extension for notebook must be .ipynb"
raise Exception(msg)
# If the notebook path has a parent directory, make sure it's created.
parent = nbpath.parent
parent.mkdir(parents=True, exist_ok=True)
Expand Down

0 comments on commit 0348c26

Please sign in to comment.