Skip to content
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

stubtest: improve allowlist documentation #15008

Merged
merged 2 commits into from
Apr 5, 2023
Merged
Changes from 1 commit
Commits
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
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

By default, stubtest will complain if an allowlist entry is not necessary
for stubtest to pass successfully.
hauntsaninja marked this conversation as resolved.
Show resolved Hide resolved

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