Skip to content

Commit 9bc9d67

Browse files
committed
Add ruff pre-commit and reformat files with it
Alternative to #151 which adds flake8
1 parent 1e80dd1 commit 9bc9d67

File tree

3 files changed

+17
-8
lines changed

3 files changed

+17
-8
lines changed

.pre-commit-config.yaml

Lines changed: 9 additions & 0 deletions
Original file line numberDiff line numberDiff line change
@@ -4,4 +4,13 @@ repos:
44
hooks:
55
- id: prettier
66
types_or: [css, javascript]
7+
- repo: https://github.com/astral-sh/ruff-pre-commit
8+
# Ruff version.
9+
rev: v0.3.4
10+
hooks:
11+
# Run the linter.
12+
- id: ruff
13+
args: [ --fix ]
14+
# Run the formatter.
15+
- id: ruff-format
716

docs/conf.py

Lines changed: 5 additions & 5 deletions
Original file line numberDiff line numberDiff line change
@@ -1,9 +1,9 @@
11
# -*- coding: utf-8 -*-
22

33
extensions = [
4-
'sphinx.ext.mathjax',
5-
'jupyterlite_sphinx',
6-
'myst_parser',
4+
"sphinx.ext.mathjax",
5+
"jupyterlite_sphinx",
6+
"myst_parser",
77
]
88

99
html_theme = "pydata_sphinx_theme"
@@ -12,10 +12,10 @@
1212
jupyterlite_contents = "./custom_contents"
1313
jupyterlite_bind_ipynb_suffix = False
1414

15-
master_doc = 'index'
15+
master_doc = "index"
1616

1717
# General information about the project.
18-
project = 'JupyterLite Sphinx extension'
18+
project = "JupyterLite Sphinx extension"
1919

2020
# theme configuration
2121
html_theme_options = {

jupyterlite_sphinx/jupyterlite_sphinx.py

Lines changed: 3 additions & 3 deletions
Original file line numberDiff line numberDiff line change
@@ -410,9 +410,9 @@ def run(self):
410410
self.content = None
411411
notebooks_dir = Path(self.env.app.srcdir) / CONTENT_DIR
412412
notebook_unique_name = f"{uuid4()}.ipynb".replace("-", "_")
413-
self.env.temp_data["generated_notebooks"][
414-
directive_key
415-
] = notebook_unique_name
413+
self.env.temp_data["generated_notebooks"][directive_key] = (
414+
notebook_unique_name
415+
)
416416
# Copy the Notebook for NotebookLite to find
417417
os.makedirs(notebooks_dir, exist_ok=True)
418418
with open(notebooks_dir / Path(notebook_unique_name), "w") as f:

0 commit comments

Comments
 (0)