Skip to content
New issue

Have a question about this project? Sign up for a free GitHub account to open an issue and contact its maintainers and the community.

By clicking “Sign up for GitHub”, you agree to our terms of service and privacy statement. We’ll occasionally send you account related emails.

Already on GitHub? Sign in to your account

Fix lint #336

Merged
merged 2 commits into from
Dec 16, 2022
Merged
Show file tree
Hide file tree
Changes from all commits
Commits
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
2 changes: 1 addition & 1 deletion .pre-commit-config.yaml
Original file line number Diff line number Diff line change
Expand Up @@ -34,7 +34,7 @@ repos:
- id: black

- repo: https://github.com/charliermarsh/ruff-pre-commit
rev: v0.0.165
rev: v0.0.180
hooks:
- id: ruff
args: ["--fix"]
2 changes: 1 addition & 1 deletion nbformat/sign.py
Original file line number Diff line number Diff line change
Expand Up @@ -528,7 +528,7 @@ def check_cells(self, nb):
return trusted


trust_flags = {
trust_flags: dict = {
"reset": (
{"TrustNotebookApp": {"reset": True}},
"""Delete the trusted notebook cache.
Expand Down
1 change: 0 additions & 1 deletion nbformat/v1/nbbase.py
Original file line number Diff line number Diff line change
Expand Up @@ -18,7 +18,6 @@

from .._struct import Struct


# -----------------------------------------------------------------------------
# Code
# -----------------------------------------------------------------------------
Expand Down
1 change: 0 additions & 1 deletion nbformat/v1/nbjson.py
Original file line number Diff line number Diff line change
Expand Up @@ -21,7 +21,6 @@
from .nbbase import from_dict
from .rwbase import NotebookReader, NotebookWriter


# -----------------------------------------------------------------------------
# Code
# -----------------------------------------------------------------------------
Expand Down
1 change: 0 additions & 1 deletion nbformat/v2/convert.py
Original file line number Diff line number Diff line change
Expand Up @@ -19,7 +19,6 @@

from .nbbase import new_code_cell, new_notebook, new_text_cell, new_worksheet


# -----------------------------------------------------------------------------
# Code
# -----------------------------------------------------------------------------
Expand Down
1 change: 0 additions & 1 deletion nbformat/v2/nbbase.py
Original file line number Diff line number Diff line change
Expand Up @@ -23,7 +23,6 @@

from .._struct import Struct


# -----------------------------------------------------------------------------
# Code
# -----------------------------------------------------------------------------
Expand Down
1 change: 0 additions & 1 deletion nbformat/v2/nbjson.py
Original file line number Diff line number Diff line change
Expand Up @@ -22,7 +22,6 @@
from .nbbase import from_dict
from .rwbase import NotebookReader, NotebookWriter, rejoin_lines, restore_bytes, split_lines


# -----------------------------------------------------------------------------
# Code
# -----------------------------------------------------------------------------
Expand Down
1 change: 0 additions & 1 deletion nbformat/v2/rwbase.py
Original file line number Diff line number Diff line change
Expand Up @@ -18,7 +18,6 @@

from base64 import decodebytes, encodebytes


# -----------------------------------------------------------------------------
# Code
# -----------------------------------------------------------------------------
Expand Down
10 changes: 5 additions & 5 deletions pyproject.toml
Original file line number Diff line number Diff line change
Expand Up @@ -54,8 +54,6 @@ test = [
"pre-commit",
"pep440"
]
lint = ["black[jupyter]>=22.6.0", "mdformat>0.7", "ruff>=0.0.156"]
typing = ["mypy>=0.990"]

[project.scripts]
jupyter-trust = "nbformat.sign:TrustNotebookApp.launch_instance"
Expand All @@ -82,12 +80,14 @@ test = "python -m pytest -vv --cov nbformat --cov-branch --cov-report term-missi
nowarn = "test -W default {args}"

[tool.hatch.envs.typing]
features = ["typing", "test"]
features = ["test"]
dependencies = ["mypy>=0.990"]
[tool.hatch.envs.typing.scripts]
test = "mypy --install-types --non-interactive {args:nbformat tests}"

[tool.hatch.envs.lint]
features = ["lint"]
dependencies = ["black[jupyter]==22.10.0", "mdformat>0.7", "ruff==0.0.180"]
detached = true
[tool.hatch.envs.lint.scripts]
style = [
"ruff {args:.}",
Expand Down Expand Up @@ -172,7 +172,7 @@ ignore = [
# Line too long
"E501",
# Relative imports are banned
"I252",
"TID252",
# Boolean ... in function definition
"FBT001", "FBT002",
# Module level import not at top of file
Expand Down
1 change: 0 additions & 1 deletion tests/test_reader.py
Original file line number Diff line number Diff line change
Expand Up @@ -17,7 +17,6 @@

from .base import TestsBase


# -----------------------------------------------------------------------------
# Classes and functions
# -----------------------------------------------------------------------------
Expand Down