You signed in with another tab or window. Reload to refresh your session.You signed out in another tab or window. Reload to refresh your session.You switched accounts on another tab or window. Reload to refresh your session.Dismiss alert
Copy file name to clipboardExpand all lines: docs/user_guide/nbtools.library.rst
+11-11Lines changed: 11 additions & 11 deletions
Display the source diff
Display the rich diff
Original file line number
Diff line number
Diff line change
@@ -5,24 +5,24 @@ Jupyter Notebooks: linting and execution
5
5
Other than `nbstat / nbwatch` monitoring utilities, this library provides a few useful tools for working with notebooks and GPUs.
6
6
7
7
8
-
ruff_notebook
9
-
*************
8
+
pylint_notebook
9
+
***************
10
10
11
-
Function that checks for errors in Jupyter Notebooks with Python code using `ruff <https://docs.astral.sh/ruff/>`_, a fast Python linter. It tries to enforce a coding standard, looks for code smells, and can detect various issues including imports, formatting, and potential bugs.
11
+
Shamelessly taken from `pylint page <https://pylint.pycqa.org/en/latest/>`_
12
12
13
-
Using it is as easy as:
13
+
Function that checks for errors in Jupyter Notebooks with Python code, tries to enforce a coding standard and looks for code smells. It can also look for certain type errors, it can recommend suggestions about how particular blocks can be refactored and can offer you details about the code's complexity.
14
14
15
-
.. code-block:: python
15
+
Using it as easy as:
16
16
17
-
from nbtools import ruff_notebook
18
-
ruff_notebook(path_to_ipynb, # If not provided, use path to the current notebook
19
-
ignore=['E402', 'F401'], # Ignore specified ruff rule codes. Can be a list.
For backward compatibility, ``pylint_notebook`` is still available as an alias to ``ruff_notebook``.
19
+
from nbtools import pylint_notebook
20
+
pylint_notebook(path_to_ipynb, # If not provided, use path to the current notebook
21
+
disable='invalid-name', # Disable specified Pylint checks. Can be a list.
22
+
enable='import-error') # Enable specified Pylint checks. Can be a list.
23
23
24
24
25
-
Under the hood, it converts `.ipynb` notebook to `.py` script, creates a custom `ruff.toml` configuration, runs `ruff` and removes all temporary files. Learn more about its usage in the [tutorial.](tutorials/NBstat.ipynb)
25
+
Under the hood, it converts `.ipynb` notebook to `.py` script, creates a custom `.pylintrc` configuration, runs the `pylint` and removes all temporary files. Learn more about its usage in the [tutorial.](tutorials/NBstat.ipynb)
0 commit comments