Skip to content

Commit

Permalink
stubtest: improve allowlist documentation (#15008)
Browse files Browse the repository at this point in the history
Could help with e.g. matplotlib/matplotlib#24976
  • Loading branch information
hauntsaninja authored Apr 5, 2023
1 parent 0f09be4 commit e21ddbf
Showing 1 changed file with 15 additions and 0 deletions.
15 changes: 15 additions & 0 deletions docs/source/stubtest.rst
Original file line number Diff line number Diff line change
Expand Up @@ -122,14 +122,29 @@ The rest of this section documents the command line interface of stubtest.
allowlists. Allowlists can be created with --generate-allowlist. Allowlists
support regular expressions.

The presence of an entry in the allowlist means stubtest will not generate
any errors for the corresponding definition.

.. option:: --generate-allowlist

Print an allowlist (to stdout) to be used with --allowlist

When introducing stubtest to an existing project, this is an easy way to
silence all existing errors.

.. option:: --ignore-unused-allowlist

Ignore unused allowlist entries

Without this option enabled, the default is for stubtest to complain if an
allowlist entry is not necessary for stubtest to pass successfully.

Note if an allowlist entry is a regex that matches the empty string,
stubtest will never consider it unused. For example, to get
`--ignore-unused-allowlist` behaviour for a single allowlist entry like
``foo.bar`` you could add an allowlist entry ``(foo\.bar)?``.
This can be useful when an error only occurs on a specific platform.

.. option:: --mypy-config-file FILE

Use specified mypy config file to determine mypy plugins and mypy path
Expand Down

0 comments on commit e21ddbf

Please sign in to comment.