diff --git a/docs/source/command_line.rst b/docs/source/command_line.rst index c1b757a00ef2..270125e96cb6 100644 --- a/docs/source/command_line.rst +++ b/docs/source/command_line.rst @@ -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 diff --git a/docs/source/config_file.rst b/docs/source/config_file.rst index 934e465a7c23..7abd1f02db68 100644 --- a/docs/source/config_file.rst +++ b/docs/source/config_file.rst @@ -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 diff --git a/mypy/main.py b/mypy/main.py index b543cd33fe44..9ebbf78ded09 100644 --- a/mypy/main.py +++ b/mypy/main.py @@ -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",