Skip to content

jupyfmt

formatter

Community plugin: Plugins are maintained by their community authors, not by the MegaLinter team. Using a plugin means trusting its author. This plugin is maintained by Kim Philipp Jablonski: report its problems on its repository, not to MegaLinter.

The uncompromising Jupyter notebook formatter

⚠️ Required items are missing in this plugin (native mode, SARIF output, cli_lint_mode): see MegaLinter checks.

jupyfmt documentation

jupyfmt - GitHub

Configuration in MegaLinter

Variable Description Default value
JUPYTER_JUPYFMT_ARGUMENTS User custom arguments to add in linter CLI call
Ex: -s --foo "bar"
JUPYTER_JUPYFMT_COMMAND_REMOVE_ARGUMENTS User custom arguments to remove from command line before calling the linter
Ex: -s --foo "bar"
JUPYTER_JUPYFMT_FILTER_REGEX_INCLUDE Custom regex including filter
Ex: (src\|lib)
Exclude no file
JUPYTER_JUPYFMT_FILTER_REGEX_EXCLUDE Custom regex excluding filter
Ex: (test\|examples)
Exclude no file
JUPYTER_JUPYFMT_CLI_LINT_MODE Override default CLI lint mode
- file: Calls the linter for each file
file
JUPYTER_JUPYFMT_FILE_EXTENSIONS Allowed file extensions. "*" matches any extension, "" matches empty extension. Empty list excludes all files
Ex: [".py", ""]
[".ipynb"]
JUPYTER_JUPYFMT_FILE_NAMES_REGEX File name regex filters. Regular expression list for filtering files by their base names using regex full match. Empty list includes all files
Ex: ["Dockerfile(-.+)?", "Jenkinsfile"]
Include every file
JUPYTER_JUPYFMT_PRE_COMMANDS List of bash commands to run before the linter None
JUPYTER_JUPYFMT_POST_COMMANDS List of bash commands to run after the linter None
JUPYTER_JUPYFMT_UNSECURED_ENV_VARIABLES List of env variables explicitly not filtered before calling JUPYTER_JUPYFMT and its pre/post commands None
JUPYTER_JUPYFMT_DISABLE_ERRORS Run linter but consider errors as warnings true
JUPYTER_JUPYFMT_DISABLE_ERRORS_IF_LESS_THAN Maximum number of errors allowed 0
JUPYTER_JUPYFMT_TIMEOUT_SECONDS Maximum duration in seconds of the linter run, after which the linter process and its child processes are killed and reported as an error (exit code 124). Overrides LINTER_TIMEOUT_SECONDS. 0 disables the timeout 300
JUPYTER_JUPYFMT_CLI_EXECUTABLE Override CLI executable ['jupyfmt']

Use this plugin

Add the descriptor URL of the plugin to PLUGINS in .mega-linter.yml. MegaLinter installs the plugin when it starts, whatever the flavor:

PLUGINS:
  - https://raw.githubusercontent.com/kpj/jupyfmt/master/mega-linter-plugin-jupyfmt/jupyfmt.megalinter-descriptor.yml

Behind the scenes

How are identified applicable files

  • File extensions: .ipynb

How the linting is performed

  • jupyfmt is called one time by identified file (file CLI lint mode)

Example calls

jupyfmt --check --compact-diff Notebook.ipynb

Installation in Docker

MegaLinter runs these commands when it loads the plugin (only RUN instructions):

RUN pip install jupyfmt

Installation without Docker (native mode)

Native mode does not run plugins yet: this section shows what the plugin declares for native mode.

Not available: see the MegaLinter checks of the plugin.

MegaLinter checks

These results last changed on 2026-11-28, and MegaLinter checks the plugins every day. The checks only look at the descriptor of the plugin: they do not review the plugin, nor the tool it runs.

Check Result
Descriptor ⚠️ Incomplete
Native mode ❌ Not supported
SARIF output ❌
Native lock ⚠️ No lock shipped by the plugin author

Required

Missing required items:

  • native_install declared and valid for the 5 native platforms (JUPYTER_JUPYFMT): Native mode (MegaLinter without Docker) can not install the linter. Declare native_install, listing each of linux/amd64, linux/arm64, darwin/amd64, darwin/arm64 and windows/amd64 in platforms or in unsupported (with a reason)
  • SARIF output (JUPYTER_JUPYFMT): The findings are missing from SARIF reports (GitHub code scanning, SARIF viewers, coding agents). Set can_output_sarif: true with cli_sarif_args when the tool outputs SARIF, otherwise sarif_text_regex (one finding per line of text) or sarif_unified_diff: true (formatters printing a diff)
  • cli_lint_mode (JUPYTER_JUPYFMT): MegaLinter calls the tool once per file, which may not be how it works. Set cli_lint_mode to file, list_of_files or project

Missing recommended items:

  • Native lock shipped next to the descriptor (<name>.megalinter-native-lock.json), for verified native installs
  • Rules documentation URL (linter_rules_url) (JUPYTER_JUPYFMT)
  • Configuration documentation URL (linter_rules_configuration_url) (JUPYTER_JUPYFMT)
  • Inline disable documentation URL (linter_rules_inline_disable_url) (JUPYTER_JUPYFMT)
  • Ignore file documentation URL (linter_rules_ignore_config_url) (JUPYTER_JUPYFMT)
  • SPDX license (linter_spdx_license) (JUPYTER_JUPYFMT)
  • Speed (linter_speed, 1 to 5) (JUPYTER_JUPYFMT)
  • Icon (linter_icon_png_url) (JUPYTER_JUPYFMT)
  • IDE extensions (ide) (JUPYTER_JUPYFMT)
  • Supported lint modes (supported_cli_lint_modes) (JUPYTER_JUPYFMT)
  • Error counting (cli_lint_errors_count and cli_lint_errors_regex) (JUPYTER_JUPYFMT)
  • Default configuration file (config_file_name) (JUPYTER_JUPYFMT)
  • Test fixtures (test_folder) (JUPYTER_JUPYFMT)

Plugin authors

The requirements and how to fix them are described in Create your own plugin.

Comments