@@ -44,6 +44,18 @@ for full details, see :ref:`running-mypy`.
44
44
Asks mypy to type check the provided string as a program.
45
45
46
46
47
+ Optional arguments
48
+ ******************
49
+
50
+ ``-h `` / ``--help ``
51
+ Show help message and exit.
52
+
53
+ ``-v `` / ``--verbose ``
54
+ More verbose messages.
55
+
56
+ ``-V `` / ``--version ``
57
+ Show program's version number and exit.
58
+
47
59
.. _config-file-flag :
48
60
49
61
Config file
@@ -87,7 +99,7 @@ imports.
87
99
module search path -- this is primarily set from the source files
88
100
passed on the command line, the ``MYPYPATH `` environment variable,
89
101
and the :ref: `mypy_path config option
90
- <config-file-import-discovery-global >`.
102
+ <config-file-import-discovery>`.
91
103
92
104
Note that this only affects import discovery -- for modules and
93
105
packages explicitly passed on the command line, mypy still
@@ -192,6 +204,7 @@ For more information on how to use these flags, see :ref:`version_and_platform_c
192
204
compile-time constants that are always false. This flag may
193
205
be repeated.
194
206
207
+
195
208
.. _disallow-dynamic-typing :
196
209
197
210
Disallow dynamic typing
@@ -247,6 +260,7 @@ The following options are available:
247
260
the base class even though that may not actually be the case. This
248
261
flag makes mypy raise an error instead.
249
262
263
+
250
264
.. _untyped-definitions-and-calls :
251
265
252
266
Untyped definitions and calls
@@ -280,6 +294,7 @@ definitions or calls.
280
294
This flag reports an error whenever a function with type annotations
281
295
is decorated with a decorator without annotations.
282
296
297
+
283
298
.. _none-and-optional-handling :
284
299
285
300
None and Optional handling
@@ -317,11 +332,11 @@ For more details, see :ref:`no_strict_optional`.
317
332
generally check the use of ``None `` values -- they are valid
318
333
everywhere. See :ref: `no_strict_optional ` for more about this feature.
319
334
320
- .. note ::
321
- Strict optional checking was enabled by default starting in
335
+ **Note: ** Strict optional checking was enabled by default starting in
322
336
mypy 0.600, and in previous versions it had to be explicitly enabled
323
337
using ``--strict-optional `` (which is still accepted).
324
338
339
+
325
340
.. _configuring-warnings :
326
341
327
342
Configuring warnings
@@ -469,6 +484,7 @@ of the above sections.
469
484
Note: the exact list of flags enabled by running ``--strict `` may change
470
485
over time.
471
486
487
+
472
488
.. _configuring-error-messages :
473
489
474
490
Configuring error messages
@@ -511,6 +527,10 @@ in error messages.
511
527
512
528
See :ref: `error-codes ` for more information.
513
529
530
+ ``--pretty ``
531
+ Use visually nicer output in error messages: use soft word wrap,
532
+ show source code snippets, and show error location markers.
533
+
514
534
``--no-color-output ``
515
535
This flag will disable color output in error messages, enabled by default.
516
536
@@ -519,6 +539,10 @@ in error messages.
519
539
including total number of errors, number of files with errors, and number
520
540
of files checked.
521
541
542
+ ``--show-absolute-path ``
543
+ Show absolute paths to files.
544
+
545
+
522
546
.. _incremental :
523
547
524
548
Incremental mode
@@ -556,14 +580,22 @@ beyond what incremental mode can offer, try running mypy in
556
580
writing to the cache, use ``--cache-dir=/dev/null `` (UNIX)
557
581
or ``--cache-dir=nul `` (Windows).
558
582
583
+ ``--sqlite-cache ``
584
+ Use an `SQLite `_ database to store the cache.
585
+
586
+ ``--cache-fine-grained ``
587
+ Include fine-grained dependency information in the cache for the mypy daemon.
588
+
559
589
``--skip-version-check ``
560
590
By default, mypy will ignore cache data generated by a different
561
591
version of mypy. This flag disables that behavior.
562
592
563
- .. _advanced-flags :
593
+ ``--skip-cache-mtime-checks ``
594
+ Skip cache internal consistency checks based on mtime.
595
+
564
596
565
- Advanced flags
566
- **************
597
+ Advanced options
598
+ ****************
567
599
568
600
The following flags are useful mostly for people who are interested
569
601
in developing or debugging mypy internals.
@@ -576,7 +608,10 @@ in developing or debugging mypy internals.
576
608
If set, this flag will display a full traceback when mypy
577
609
encounters a fatal error.
578
610
579
- ``--custom-typing MODULE ``
611
+ ``--raise-exceptions ``
612
+ Raise exception on fatal error.
613
+
614
+ ``--custom-typing-module MODULE ``
580
615
This flag lets you use a custom module as a substitute for the
581
616
:py:mod: `typing ` module.
582
617
@@ -622,6 +657,7 @@ in developing or debugging mypy internals.
622
657
cause mypy to type check the contents of ``temp.py `` instead of ``original.py ``,
623
658
but error messages will still reference ``original.py ``.
624
659
660
+
625
661
Report generation
626
662
*****************
627
663
@@ -632,6 +668,16 @@ format into the specified directory.
632
668
Causes mypy to generate a text file report documenting how many
633
669
expressions of type ``Any `` are present within your codebase.
634
670
671
+ ``--cobertura-xml-report DIR ``
672
+ Causes mypy to generate a Cobertura XML type checking coverage report.
673
+
674
+ You must install the `lxml `_ library to generate this report.
675
+
676
+ ``--html-report `` / ``--xslt-html-report DIR ``
677
+ Causes mypy to generate an HTML type checking coverage report.
678
+
679
+ You must install the `lxml `_ library to generate this report.
680
+
635
681
``--linecount-report DIR ``
636
682
Causes mypy to generate a text file report documenting the functions
637
683
and lines that are typed and untyped within your codebase.
@@ -641,30 +687,29 @@ format into the specified directory.
641
687
absolute filename to a list of line numbers that belong to typed
642
688
functions in that file.
643
689
644
- ``--cobertura-xml-report DIR ``
645
- Causes mypy to generate a Cobertura XML type checking coverage report.
690
+ ``--lineprecision-report DIR ``
691
+ Causes mypy to generate a flat text file report with per-module
692
+ statistics of how many lines are typechecked etc.
693
+
694
+ ``--txt-report `` / ``--xslt-txt-report DIR ``
695
+ Causes mypy to generate a text file type checking coverage report.
646
696
647
697
You must install the `lxml `_ library to generate this report.
648
698
649
- ``--html-report DIR ``, `` --xslt-html -report DIR ``
650
- Causes mypy to generate an HTML type checking coverage report.
699
+ ``--xml -report DIR ``
700
+ Causes mypy to generate an XML type checking coverage report.
651
701
652
702
You must install the `lxml `_ library to generate this report.
653
703
654
- ``--txt-report DIR ``, ``--xslt-txt-report DIR ``
655
- Causes mypy to generate a text file type checking coverage report.
656
704
657
- You must install the `lxml `_ library to generate this report.
705
+ Miscellaneous
706
+ *************
658
707
659
708
``--junit-xml JUNIT_XML ``
660
709
Causes mypy to generate a JUnit XML test result document with
661
710
type checking results. This can make it easier to integrate mypy
662
711
with continuous integration (CI) tools.
663
712
664
-
665
- Miscellaneous
666
- *************
667
-
668
713
``--find-occurrences CLASS.MEMBER ``
669
714
This flag will make mypy print out all usages of a class member
670
715
based on static type information. This feature is experimental.
@@ -681,3 +726,4 @@ Miscellaneous
681
726
by this flag is often more convenient.)
682
727
683
728
.. _lxml : https://pypi.org/project/lxml/
729
+ .. _SQLite : https://www.sqlite.org/
0 commit comments