Skip to content

Update to config file doc to match command line doc and --help #7776

New issue

Have a question about this project? Sign up for a free GitHub account to open an issue and contact its maintainers and the community.

By clicking “Sign up for GitHub”, you agree to our terms of service and privacy statement. We’ll occasionally send you account related emails.

Already on GitHub? Sign in to your account

Merged
merged 35 commits into from
Oct 23, 2019
Merged
Show file tree
Hide file tree
Changes from all commits
Commits
Show all changes
35 commits
Select commit Hold shift + click to select a range
394b71c
Preparing to restructure the document to removing the separation of o…
jolaf Oct 21, 2019
6dfb4c2
Merging "Import discovery" sections
jolaf Oct 21, 2019
e25668b
Reordering sections: moving Examples to the end of the preface part.
jolaf Oct 21, 2019
4937647
Fixing broken links.
jolaf Oct 21, 2019
9e9ab74
Reordering options and sections to match the command line doc
jolaf Oct 21, 2019
2b0c505
Old typo fixed (Optional should be written with capital O)
jolaf Oct 21, 2019
8b5cff1
Removed new_semantic_analyzer option that is now obsolete as the old …
jolaf Oct 21, 2019
7480ff4
Unifying section separators
jolaf Oct 22, 2019
8f3a33c
Note formatting fixed
jolaf Oct 22, 2019
525a25a
Added allow_untyped_globals description from command line doc
jolaf Oct 22, 2019
1e55ebc
"Advanced flags" section renamed to "Advanced options" to match the c…
jolaf Oct 22, 2019
7132a2d
Copied "Report generation" section from command line documentation
jolaf Oct 22, 2019
f9b2dbb
Added options mentioned in `--help` but lacking documentation
jolaf Oct 22, 2019
0fb3f98
Minor description correction
jolaf Oct 22, 2019
d2e738f
Added options that are mentioned in `--help` but were otherwise undoc…
jolaf Oct 22, 2019
72f1564
Minor formatting fix
jolaf Oct 22, 2019
1b5f20d
Fixed #7772.
Oct 22, 2019
6617210
Sections in --help are renamed to match the command line documentation
Oct 22, 2019
9873348
Sections in --help reordered match the command line documentation
Oct 22, 2019
4f399c5
Report generations options reordered to match the order in --help
Oct 22, 2019
b786b3b
Options in --help reordered to match the command line documentation
Oct 22, 2019
81d05a0
Formatting improvement to Report generation options
Oct 22, 2019
bb1a2c7
Documentation for -h, -v, -V command line options added
Oct 22, 2019
6d73487
Improving Report generation options documentation as discussed
jolaf Oct 22, 2019
d70a864
Improving Report generation options documentation as discussed
jolaf Oct 22, 2019
51228fa
Removed --strict-optional-whitelist option from documentation as disc…
jolaf Oct 22, 2019
ec2e47b
Fixed --pretty documentation as discussed.
jolaf Oct 22, 2019
4484724
Moving mypy_path and files to the top of the section, as discussed
jolaf Oct 22, 2019
7ae1549
--no-strict-optional notes made less visible
jolaf Oct 22, 2019
e18c670
Restored an accidentally lost blurb; also fixing typography for other…
jolaf Oct 23, 2019
109b100
Fixed custom typing module option name
jolaf Oct 23, 2019
68faeda
Merge branch 'master' into options-doc
jolaf Oct 23, 2019
c6c0984
Merge branch 'master' into options-doc
jolaf Oct 23, 2019
68e5ca4
Added documentation for --show-absolute-path.
jolaf Oct 23, 2019
1b0e183
flake8 fix
jolaf Oct 23, 2019
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
82 changes: 64 additions & 18 deletions docs/source/command_line.rst
Original file line number Diff line number Diff line change
Expand Up @@ -44,6 +44,18 @@ for full details, see :ref:`running-mypy`.
Asks mypy to type check the provided string as a program.


Optional arguments
******************

``-h`` / ``--help``
Show help message and exit.

``-v`` / ``--verbose``
More verbose messages.

``-V`` / ``--version``
Show program's version number and exit.

.. _config-file-flag:

Config file
Expand Down Expand Up @@ -87,7 +99,7 @@ imports.
module search path -- this is primarily set from the source files
passed on the command line, the ``MYPYPATH`` environment variable,
and the :ref:`mypy_path config option
<config-file-import-discovery-global>`.
<config-file-import-discovery>`.

Note that this only affects import discovery -- for modules and
packages explicitly passed on the command line, mypy still
Expand Down Expand Up @@ -192,6 +204,7 @@ For more information on how to use these flags, see :ref:`version_and_platform_c
compile-time constants that are always false. This flag may
be repeated.


.. _disallow-dynamic-typing:

Disallow dynamic typing
Expand Down Expand Up @@ -247,6 +260,7 @@ The following options are available:
the base class even though that may not actually be the case. This
flag makes mypy raise an error instead.


.. _untyped-definitions-and-calls:

Untyped definitions and calls
Expand Down Expand Up @@ -280,6 +294,7 @@ definitions or calls.
This flag reports an error whenever a function with type annotations
is decorated with a decorator without annotations.


.. _none-and-optional-handling:

None and Optional handling
Expand Down Expand Up @@ -317,11 +332,11 @@ For more details, see :ref:`no_strict_optional`.
generally check the use of ``None`` values -- they are valid
everywhere. See :ref:`no_strict_optional` for more about this feature.

.. note::
Strict optional checking was enabled by default starting in
**Note:** Strict optional checking was enabled by default starting in
mypy 0.600, and in previous versions it had to be explicitly enabled
using ``--strict-optional`` (which is still accepted).


.. _configuring-warnings:

Configuring warnings
Expand Down Expand Up @@ -469,6 +484,7 @@ of the above sections.
Note: the exact list of flags enabled by running ``--strict`` may change
over time.


.. _configuring-error-messages:

Configuring error messages
Expand Down Expand Up @@ -511,6 +527,10 @@ in error messages.

See :ref:`error-codes` for more information.

``--pretty``
Use visually nicer output in error messages: use soft word wrap,
show source code snippets, and show error location markers.

``--no-color-output``
This flag will disable color output in error messages, enabled by default.

Expand All @@ -519,6 +539,10 @@ in error messages.
including total number of errors, number of files with errors, and number
of files checked.

``--show-absolute-path``
Show absolute paths to files.


.. _incremental:

Incremental mode
Expand Down Expand Up @@ -556,14 +580,22 @@ beyond what incremental mode can offer, try running mypy in
writing to the cache, use ``--cache-dir=/dev/null`` (UNIX)
or ``--cache-dir=nul`` (Windows).

``--sqlite-cache``
Use an `SQLite`_ database to store the cache.

``--cache-fine-grained``
Include fine-grained dependency information in the cache for the mypy daemon.

``--skip-version-check``
By default, mypy will ignore cache data generated by a different
version of mypy. This flag disables that behavior.

.. _advanced-flags:
``--skip-cache-mtime-checks``
Skip cache internal consistency checks based on mtime.


Advanced flags
**************
Advanced options
****************

The following flags are useful mostly for people who are interested
in developing or debugging mypy internals.
Expand All @@ -576,7 +608,10 @@ in developing or debugging mypy internals.
If set, this flag will display a full traceback when mypy
encounters a fatal error.

``--custom-typing MODULE``
``--raise-exceptions``
Raise exception on fatal error.

``--custom-typing-module MODULE``
This flag lets you use a custom module as a substitute for the
:py:mod:`typing` module.

Expand Down Expand Up @@ -622,6 +657,7 @@ in developing or debugging mypy internals.
cause mypy to type check the contents of ``temp.py`` instead of ``original.py``,
but error messages will still reference ``original.py``.


Report generation
*****************

Expand All @@ -632,6 +668,16 @@ format into the specified directory.
Causes mypy to generate a text file report documenting how many
expressions of type ``Any`` are present within your codebase.

``--cobertura-xml-report DIR``
Causes mypy to generate a Cobertura XML type checking coverage report.

You must install the `lxml`_ library to generate this report.

``--html-report`` / ``--xslt-html-report DIR``
Causes mypy to generate an HTML type checking coverage report.

You must install the `lxml`_ library to generate this report.

``--linecount-report DIR``
Causes mypy to generate a text file report documenting the functions
and lines that are typed and untyped within your codebase.
Expand All @@ -641,30 +687,29 @@ format into the specified directory.
absolute filename to a list of line numbers that belong to typed
functions in that file.

``--cobertura-xml-report DIR``
Causes mypy to generate a Cobertura XML type checking coverage report.
``--lineprecision-report DIR``
Causes mypy to generate a flat text file report with per-module
statistics of how many lines are typechecked etc.

``--txt-report`` / ``--xslt-txt-report DIR``
Causes mypy to generate a text file type checking coverage report.

You must install the `lxml`_ library to generate this report.

``--html-report DIR``, ``--xslt-html-report DIR``
Causes mypy to generate an HTML type checking coverage report.
``--xml-report DIR``
Causes mypy to generate an XML type checking coverage report.

You must install the `lxml`_ library to generate this report.

``--txt-report DIR``, ``--xslt-txt-report DIR``
Causes mypy to generate a text file type checking coverage report.

You must install the `lxml`_ library to generate this report.
Miscellaneous
*************

``--junit-xml JUNIT_XML``
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.


Miscellaneous
*************

``--find-occurrences CLASS.MEMBER``
This flag will make mypy print out all usages of a class member
based on static type information. This feature is experimental.
Expand All @@ -681,3 +726,4 @@ Miscellaneous
by this flag is often more convenient.)

.. _lxml: https://pypi.org/project/lxml/
.. _SQLite: https://www.sqlite.org/
Loading