From a8ea37a8dd11279143e6512ce549875c4bdc79eb Mon Sep 17 00:00:00 2001 From: wyattscarpenter Date: Wed, 17 Sep 2025 14:22:54 +0700 Subject: [PATCH 1/4] Improve report --help documentation --- mypy/main.py | 4 ++-- 1 file changed, 2 insertions(+), 2 deletions(-) diff --git a/mypy/main.py b/mypy/main.py index fd50c7677a112..46c8f37afda3f 100644 --- a/mypy/main.py +++ b/mypy/main.py @@ -1127,13 +1127,13 @@ def add_invertible_flag( internals_group.add_argument("--export-ref-info", action="store_true", help=argparse.SUPPRESS) report_group = parser.add_argument_group( - title="Report generation", description="Generate a report in the specified format." + title="Report generation", description="Generate a report in the specified format in the specified directory." ) for report_type in sorted(defaults.REPORTER_NAMES): if report_type not in {"memory-xml"}: report_group.add_argument( f"--{report_type.replace('_', '-')}-report", - metavar="DIR", + metavar="OUTPUT_DIR", dest=f"special-opts:{report_type}_report", ) From 8d6d66cc41f7d9ecbe0dd837ad7cb770e9b2bb46 Mon Sep 17 00:00:00 2001 From: "pre-commit-ci[bot]" <66853113+pre-commit-ci[bot]@users.noreply.github.com> Date: Wed, 17 Sep 2025 07:35:12 +0000 Subject: [PATCH 2/4] [pre-commit.ci] auto fixes from pre-commit.com hooks for more information, see https://pre-commit.ci --- mypy/main.py | 3 ++- 1 file changed, 2 insertions(+), 1 deletion(-) diff --git a/mypy/main.py b/mypy/main.py index 46c8f37afda3f..fd07cebd07b8c 100644 --- a/mypy/main.py +++ b/mypy/main.py @@ -1127,7 +1127,8 @@ def add_invertible_flag( internals_group.add_argument("--export-ref-info", action="store_true", help=argparse.SUPPRESS) report_group = parser.add_argument_group( - title="Report generation", description="Generate a report in the specified format in the specified directory." + title="Report generation", + description="Generate a report in the specified format in the specified directory.", ) for report_type in sorted(defaults.REPORTER_NAMES): if report_type not in {"memory-xml"}: From 5aa43abe849aea4af6e5aa894e42b93e6e439180 Mon Sep 17 00:00:00 2001 From: wyattscarpenter Date: Thu, 18 Sep 2025 03:23:37 +0700 Subject: [PATCH 3/4] Update command_line.rst: write OUTPUT_DIR here, too --- docs/source/command_line.rst | 16 ++++++++-------- 1 file changed, 8 insertions(+), 8 deletions(-) diff --git a/docs/source/command_line.rst b/docs/source/command_line.rst index db2407e17df8b..361adc6c3e70e 100644 --- a/docs/source/command_line.rst +++ b/docs/source/command_line.rst @@ -1089,12 +1089,12 @@ Report generation If these flags are set, mypy will generate a report in the specified format into the specified directory. -.. option:: --any-exprs-report DIR +.. option:: --any-exprs-report OUTPUT_DIR Causes mypy to generate a text file report documenting how many expressions of type ``Any`` are present within your codebase. -.. option:: --cobertura-xml-report DIR +.. option:: --cobertura-xml-report OUTPUT_DIR Causes mypy to generate a Cobertura XML type checking coverage report. @@ -1102,7 +1102,7 @@ format into the specified directory. library or specify mypy installation with the setuptools extra ``mypy[reports]``. -.. option:: --html-report / --xslt-html-report DIR +.. option:: --html-report / --xslt-html-report OUTPUT_DIR Causes mypy to generate an HTML type checking coverage report. @@ -1110,23 +1110,23 @@ format into the specified directory. library or specify mypy installation with the setuptools extra ``mypy[reports]``. -.. option:: --linecount-report DIR +.. option:: --linecount-report OUTPUT_DIR Causes mypy to generate a text file report documenting the functions and lines that are typed and untyped within your codebase. -.. option:: --linecoverage-report DIR +.. option:: --linecoverage-report OUTPUT_DIR Causes mypy to generate a JSON file that maps each source file's absolute filename to a list of line numbers that belong to typed functions in that file. -.. option:: --lineprecision-report DIR +.. option:: --lineprecision-report OUTPUT_DIR Causes mypy to generate a flat text file report with per-module statistics of how many lines are typechecked etc. -.. option:: --txt-report / --xslt-txt-report DIR +.. option:: --txt-report / --xslt-txt-report OUTPUT_DIR Causes mypy to generate a text file type checking coverage report. @@ -1134,7 +1134,7 @@ format into the specified directory. library or specify mypy installation with the setuptools extra ``mypy[reports]``. -.. option:: --xml-report DIR +.. option:: --xml-report OUTPUT_DIR Causes mypy to generate an XML type checking coverage report. From 937f238b3841121310271f12fe5ceac5bd5a013d Mon Sep 17 00:00:00 2001 From: wyattscarpenter Date: Thu, 18 Sep 2025 03:26:04 +0700 Subject: [PATCH 4/4] Since the long documentation already says "into", use that --- mypy/main.py | 2 +- 1 file changed, 1 insertion(+), 1 deletion(-) diff --git a/mypy/main.py b/mypy/main.py index fd07cebd07b8c..7484442e74294 100644 --- a/mypy/main.py +++ b/mypy/main.py @@ -1128,7 +1128,7 @@ def add_invertible_flag( report_group = parser.add_argument_group( title="Report generation", - description="Generate a report in the specified format in the specified directory.", + description="Generate a report in the specified format into the specified directory.", ) for report_type in sorted(defaults.REPORTER_NAMES): if report_type not in {"memory-xml"}: