diff --git a/docs/source/command_line.rst b/docs/source/command_line.rst index 78869fb10bbd..727316a34310 100644 --- a/docs/source/command_line.rst +++ b/docs/source/command_line.rst @@ -278,7 +278,8 @@ Here are some more useful flags: - ``--disallow-any`` disallows various types of ``Any`` in a module. The option takes a comma-separated list of the following values: - ``unimported``, ``unannotated``, ``expr``, ``decorated``, ``explicit``. + ``unimported``, ``unannotated``, ``expr``, ``decorated``, ``explicit``, + ``generics``. ``unimported`` disallows usage of types that come from unfollowed imports (such types become aliases for ``Any``). Unfollowed imports occur either @@ -304,6 +305,11 @@ Here are some more useful flags: ``explicit`` disallows explicit ``Any`` in type positions such as type annotations and generic type parameters. + ``generics`` disallows usage of generic types that do not specify explicit + type parameters. Moreover, built-in collections (such as ``list`` and + ``dict``) become disallowed as you should use their aliases from the typing + module (such as ``List[int]`` and ``Dict[str, str]``). + - ``--disallow-untyped-defs`` reports an error whenever it encounters a function definition without type annotations. diff --git a/docs/source/config_file.rst b/docs/source/config_file.rst index 20fc4241f409..6a32414cc571 100644 --- a/docs/source/config_file.rst +++ b/docs/source/config_file.rst @@ -150,8 +150,8 @@ overridden by the pattern sections matching the module name. - ``disallow_any`` (Comma-separated list, default empty) is an option to disallow various types of ``Any`` in a module. The flag takes a comma-separated list of the following arguments: ``unimported``, - ``unannotated``, ``expr``, ``decorated``, ``explicit``. For explanations - see the discussion for the :ref:`--disallow-any ` option. + ``unannotated``, ``expr``, ``decorated``, ``explicit``, ``generics``. + For explanations see the discussion for the :ref:`--disallow-any ` option. - ``disallow_untyped_calls`` (Boolean, default False) disallows calling functions without type annotations from functions with type