Skip to content
Merged
Show file tree
Hide file tree
Changes from all commits
Commits
File filter

Filter by extension

Filter by extension

Conversations
Failed to load comments.
Loading
Jump to
Jump to file
Failed to load files.
Loading
Diff view
Diff view
8 changes: 7 additions & 1 deletion docs/source/command_line.rst
Original file line number Diff line number Diff line change
Expand Up @@ -1255,12 +1255,18 @@ Miscellaneous
stub packages were found, they are installed and then another run
is performed.

.. option:: --junit-xml JUNIT_XML
.. option:: --junit-xml JUNIT_XML_OUTPUT_FILE

Causes mypy to generate a JUnit XML test result document with
type checking results. This can make it easier to integrate mypy
with continuous integration (CI) tools.

.. option:: --junit-format {global,per_file}

If --junit-xml is set, specifies format.
global (default): single test with all errors;
per_file: one test entry per file with failures.

.. option:: --find-occurrences CLASS.MEMBER

This flag will make mypy print out all usages of a class member
Expand Down
9 changes: 9 additions & 0 deletions docs/source/config_file.rst
Original file line number Diff line number Diff line change
Expand Up @@ -1153,6 +1153,15 @@ These options may only be set in the global section (``[mypy]``).
type checking results. This can make it easier to integrate mypy
with continuous integration (CI) tools.

.. confval:: junit_format

:type: string
:default: ``global``

If junit_xml is set, specifies format.
global (default): single test with all errors;
per_file: one test entry per file with failures.

.. confval:: scripts_are_modules

:type: boolean
Expand Down
10 changes: 7 additions & 3 deletions mypy/main.py
Original file line number Diff line number Diff line change
Expand Up @@ -1165,12 +1165,16 @@ def add_invertible_flag(

misc_group = parser.add_argument_group(title="Miscellaneous")
misc_group.add_argument("--quickstart-file", help=argparse.SUPPRESS)
misc_group.add_argument("--junit-xml", help="Write junit.xml to the given file")
imports_group.add_argument(
misc_group.add_argument(
"--junit-xml",
metavar="JUNIT_XML_OUTPUT_FILE",
help="Write a JUnit XML test result document with type checking results to the given file",
)
misc_group.add_argument(
"--junit-format",
choices=["global", "per_file"],
default="global",
help="If --junit-xml is set, specifies format. global: single test with all errors; per_file: one test entry per file with failures",
help="If --junit-xml is set, specifies format. global (default): single test with all errors; per_file: one test entry per file with failures",
)
misc_group.add_argument(
"--find-occurrences",
Expand Down
Loading