Configuration¶
You can configure the debugging tools using a dojo.toml
or
pyproject.toml
file. The configuration allows you to specify which
debugger to use, enable or disable features, and set various options.
debug-dojo
looks for configuration in the following order:
- A file specified by the
--config
CLI option. dojo.toml
in the current working directory.pyproject.toml
in the current working directory.dojo.toml
in the user’s config directory (e.g.,~/.config/dojo.toml
).
Example dojo.toml
:
Configuration Sections¶
[debuggers]
¶
This section controls the behavior of the integrated debuggers.
default
(string, default:ipdb
): Specifies the default debugger to use whendebug-dojo
is invoked without a--debugger
flag. Valid options aredebugpy
,ipdb
,pdb
, andpudb
.prompt_name
(string, default:debug-dojo>
): Sets the prompt string displayed in the debugger’s REPL.
[debuggers.debugpy]
¶
Specific settings for the debugpy
debugger.
host
(string, default:localhost
): The host address fordebugpy
to listen on.log_to_file
(boolean, default:false
): Iftrue
,debugpy
will log its output to a file.port
(integer, default:1992
): The port numberdebugpy
will use for communication.wait_for_client
(boolean, default:true
): Iftrue
,debug-dojo
will pause execution and wait for a debugger client (e.g., VS Code) to connect before proceeding.
[debuggers.ipdb]
¶
Specific settings for the ipdb
debugger.
context_lines
(integer, default:20
): The number of context lines to display around the current line inipdb
.
[debuggers.pdb]
and [debuggers.pudb]
¶
Currently, pdb
and pudb
do not have specific configurable options beyond their default behavior.
[exceptions]
¶
This section configures how debug-dojo
handles exceptions.
locals_in_traceback
(boolean, default:false
): Iftrue
, local variables will be included in the traceback output, providing more context for errors.post_mortem
(boolean, default:true
): Iftrue
,debug-dojo
will automatically enter a post-mortem debugging session (using the configured debugger) when an unhandled exception occurs.rich_traceback
(boolean, default:true
): Iftrue
, tracebacks will be rendered usingrich
, providing colorized and more readable output.
[features]
¶
This section allows you to customize the mnemonics (short names) for the debug-dojo
helper functions that are injected into builtins when debug_dojo.install
is used. Setting a mnemonic to an empty string (""
) will disable that feature.
breakpoint
(string, default:b
): The mnemonic for the breakpoint function. (e.g.,b()
)comparer
(string, default:c
): The mnemonic for the object comparison function. (e.g.,c(obj1, obj2)
)rich_inspect
(string, default:i
): The mnemonic for the rich object inspection function. (e.g.,i(obj)
)rich_print
(string, default:p
): The mnemonic for the rich pretty printing function. (e.g.,p(obj)
)