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

update ruff usage #107

Merged
merged 1 commit into from
Aug 30, 2024
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
12 changes: 6 additions & 6 deletions Makefile
Original file line number Diff line number Diff line change
Expand Up @@ -27,18 +27,18 @@ tests: testpy testjs ## run the tests
###########
# Linting #
###########
lintpy: ## Black/flake8 python
python -m ruff jupyterlab_commands setup.py
python -m black --check jupyterlab_commands setup.py
lintpy: ## lint python with ruff
python -m ruff check jupyterlab_commands
python -m ruff format --check jupyterlab_commands

lintjs: ## ESlint javascript
cd js; yarn lint

lint: lintpy lintjs ## run linter

fixpy: ## Black python
python -m ruff jupyterlab_commands setup.py --fix
python -m black jupyterlab_commands/ setup.py
fixpy: ## autoformat python with ruff
python -m ruff check --fix jupyterlab_commands
python -m ruff format jupyterlab_commands

fixjs: ## ESlint Autofix JS
cd js; yarn fix
Expand Down
5 changes: 1 addition & 4 deletions jupyterlab_commands/extension.py
Original file line number Diff line number Diff line change
Expand Up @@ -49,10 +49,7 @@ def load_jupyter_server_extension(nb_server_app):
base_url = web_app.settings["base_url"]

host_pattern = ".*$"
nb_server_app.log.info(
"Installing jupyterlab_commands handler on path %s"
% url_path_join(base_url, "commands")
)
nb_server_app.log.info("Installing jupyterlab_commands handler on path %s" % url_path_join(base_url, "commands"))

nb_server_app.log.info("Available commands: %s" % ",".join(k for k in commands))
web_app.add_handlers(
Expand Down
4 changes: 1 addition & 3 deletions jupyterlab_commands/tests/test_init.py
Original file line number Diff line number Diff line change
Expand Up @@ -3,6 +3,4 @@

class TestInit:
def test__jupyter_server_extension_paths(self):
assert _jupyter_server_extension_paths() == [
{"module": "jupyterlab_commands.extension"}
]
assert _jupyter_server_extension_paths() == [{"module": "jupyterlab_commands.extension"}]
17 changes: 14 additions & 3 deletions pyproject.toml
Original file line number Diff line number Diff line change
Expand Up @@ -38,7 +38,6 @@ dependencies = [

[project.optional-dependencies]
develop = [
"black>=23",
"check-manifest",
"ruff",
"pytest",
Expand Down Expand Up @@ -96,5 +95,17 @@ build_cmd = "build"
[tool.ruff]
line-length = 120

[tool.ruff.per-file-ignores]
"__init__.py" = ["F401"]
[tool.ruff.lint.isort]
combine-as-imports = true
default-section = "third-party"
known-first-party = ["jupyterlab_commands"]
section-order = [
"future",
"standard-library",
"third-party",
"first-party",
"local-folder",
]

[tool.ruff.lint.per-file-ignores]
"__init__.py" = ["F401", "F403"]
Loading