Movatterモバイル変換


[0]ホーム

URL:


Skip to content

Navigation Menu

Sign in
Appearance settings

Search code, repositories, users, issues, pull requests...

Provide feedback

We read every piece of feedback, and take your input very seriously.

Saved searches

Use saved searches to filter your results more quickly

Sign up
Appearance settings

Update ruff config and typing#7145

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 ourterms of service andprivacy statement. We’ll occasionally send you account related emails.

Already on GitHub?Sign in to your account

Merged
blink1073 merged 2 commits intojupyter:mainfromblink1073:update-ruff-config
Nov 10, 2023
Merged
Show file tree
Hide file tree
Changes from1 commit
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
NextNext commit
Update ruff config and typing
  • Loading branch information
@blink1073
blink1073 committedNov 10, 2023
commit7de30b04fe5597e7b23e57e04540e181d5e67734
6 changes: 4 additions & 2 deletions.pre-commit-config.yaml
View file
Open in desktop
Original file line numberDiff line numberDiff line change
Expand Up@@ -50,7 +50,7 @@ repos:
files: "^notebook"
stages: [manual]
args: ["--install-types", "--non-interactive"]
additional_dependencies: ["traitlets>=5.13", "tornado", "jupyter_server>=2.9", "jupyterlab_server>=2.25", "jupyterlab>=4.0"]
additional_dependencies: ["traitlets>=5.13", "tornado", "jupyter_server>=2.10", "jupyterlab_server>=2.25", "jupyterlab>=4.0"]

- repo: https://github.com/pre-commit/pygrep-hooks
rev: 'v1.10.0'
Expand All@@ -60,11 +60,13 @@ repos:
- id: rst-inline-touching-normal

- repo: https://github.com/astral-sh/ruff-pre-commit
rev: v0.1.4
rev: v0.1.5
hooks:
- id: ruff
types_or: [ python, jupyter ]
args: ['--fix', '--show-fixes']
- id: ruff-format
types_or: [ python, jupyter ]

- repo: https://github.com/scientific-python/cookie
rev: '2023.10.27'
Expand Down
3 changes: 3 additions & 0 deletionsnotebook/app.py
View file
Open in desktop
Original file line numberDiff line numberDiff line change
Expand Up@@ -301,6 +301,8 @@ def _prepare_templates(self) -> None:

def server_extension_is_enabled(self, extension: str) -> bool:
"""Check if server extension is enabled."""
if self.serverapp is None:
return False
try:
extension_enabled = (
self.serverapp.extension_manager.extensions[extension].enabled is True
Expand All@@ -311,6 +313,7 @@ def server_extension_is_enabled(self, extension: str) -> bool:

def initialize_handlers(self) -> None:
"""Initialize handlers."""
assert self.serverapp is not None # noqa: S101
page_config = self.serverapp.web_app.settings.setdefault("page_config_data", {})
nbclassic_enabled = self.server_extension_is_enabled("nbclassic")
page_config["nbclassic_enabled"] = nbclassic_enabled
Expand Down
6 changes: 4 additions & 2 deletionspyproject.toml
View file
Open in desktop
Original file line numberDiff line numberDiff line change
Expand Up@@ -138,7 +138,10 @@ nowarn = "test -W default {args}"
detached = true
dependencies = ["pre-commit"]
[tool.hatch.envs.lint.scripts]
build = "pre-commit run --all-files ruff"
build = [
"pre-commit run --all-files ruff",
"pre-commit run --all-files ruff-format"
]

[tool.hatch.envs.typing]
dependencies = [ "pre-commit"]
Expand DownExpand Up@@ -233,7 +236,6 @@ enable_error_code = ["ignore-without-code", "redundant-expr", "truthy-bool"]
warn_unreachable = true

[tool.ruff]
target-version = "py38"
line-length = 100

[tool.ruff.lint]
Expand Down

[8]ページ先頭

©2009-2025 Movatter.jp