You can configure Ward using the standard
pyproject.toml configuration file, defined in
You don't need a
pyproject.toml file to use Ward.
Ward will read your
pyproject.toml file and treat the values inside it as defaults.
If you pass an option via the command line that also appears in your
the option supplied via the command line takes priority.
Where Ward looks for
In summary, the process it uses is:
- Find the common base directory of all files passed in via the
--pathoption (default to the current working directory).
- Starting from this directory, look at all parent directories, and return the file if it is found.
- If a directory contains a
.hgdirectory, or the
pyproject.tomlfile, stop searching.
This is the same process Black (the popular code formatting tool) uses to discover the file.
pyproject.toml file contains different sections for different tools. Ward uses the
[tool.ward]path = ["unit_tests", "integration_tests"] # supply multiple paths using a listcapture-output = false # enable or disable output capturing (e.g. to use debugger)order = "standard" # or 'random'output-mode = "test-per-line" # or 'dots-global', 'dot-module'fail-limit = 20 # stop the run if 20 fails occursearch = "my_function" # search in test body or description