diff options
author | Pierre Sassoulas <pierre.sassoulas@gmail.com> | 2022-12-05 19:12:15 +0100 |
---|---|---|
committer | GitHub <noreply@github.com> | 2022-12-05 19:12:15 +0100 |
commit | ffef6f0c0e0ad1e54ea412f77e38a8628f3d32c8 (patch) | |
tree | d13df0f159e5779ac7385ff05cd76def7f32877c /doc/user_guide | |
parent | d1db7df4a369c92c3b8811335c3f6c72ed8b8415 (diff) | |
download | pylint-git-ffef6f0c0e0ad1e54ea412f77e38a8628f3d32c8.tar.gz |
[doc] Upgrade generated doc and create example for redundant-typehint-argument (#7904)
Diffstat (limited to 'doc/user_guide')
-rw-r--r-- | doc/user_guide/checkers/extensions.rst | 5 | ||||
-rw-r--r-- | doc/user_guide/checkers/features.rst | 11 | ||||
-rw-r--r-- | doc/user_guide/messages/messages_overview.rst | 4 |
3 files changed, 18 insertions, 2 deletions
diff --git a/doc/user_guide/checkers/extensions.rst b/doc/user_guide/checkers/extensions.rst index 0eaf22792..a3ff636a8 100644 --- a/doc/user_guide/checkers/extensions.rst +++ b/doc/user_guide/checkers/extensions.rst @@ -275,7 +275,7 @@ Verbatim name of the checker is ``dict-init-mutate``. Dict-Init-Mutate checker Messages ^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^ -:dict-init-mutate (C3401): *Dictionary mutated immediately after initialization* +:dict-init-mutate (C3401): *Declare all known key/values when initializing the dictionary.* Dictionaries can be initialized with a single statement using dictionary literal syntax. @@ -697,6 +697,9 @@ Typing checker Messages :consider-alternative-union-syntax (R6003): *Consider using alternative Union syntax instead of '%s'%s* Emitted when 'typing.Union' or 'typing.Optional' is used instead of the alternative Union syntax 'int | None'. +:redundant-typehint-argument (R6006): *Type `%s` is used more than once in union type annotation. Remove redundant typehints.* + Duplicated type arguments will be skipped by `mypy` tool, therefore should be + removed to avoid confusion. .. _pylint.extensions.while_used: diff --git a/doc/user_guide/checkers/features.rst b/doc/user_guide/checkers/features.rst index 350511069..f86b0c874 100644 --- a/doc/user_guide/checkers/features.rst +++ b/doc/user_guide/checkers/features.rst @@ -682,6 +682,17 @@ Modified Iteration checker Messages use a copy of the list. +Nested Min Max checker +~~~~~~~~~~~~~~~~~~~~~~ + +Verbatim name of the checker is ``nested_min_max``. + +Nested Min Max checker Messages +^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^ +:nested-min-max (W3301): *Do not use nested call of '%s'; it's possible to do '%s' instead* + Nested calls ``min(1, min(2, 3))`` can be rewritten as ``min(1, 2, 3)``. + + Newstyle checker ~~~~~~~~~~~~~~~~ diff --git a/doc/user_guide/messages/messages_overview.rst b/doc/user_guide/messages/messages_overview.rst index 89c825331..74b8dbb8a 100644 --- a/doc/user_guide/messages/messages_overview.rst +++ b/doc/user_guide/messages/messages_overview.rst @@ -231,7 +231,6 @@ All messages in the warning category: warning/deprecated-method warning/deprecated-module warning/deprecated-typing-alias - warning/dict-init-mutate warning/differing-param-doc warning/differing-type-doc warning/duplicate-except @@ -281,6 +280,7 @@ All messages in the warning category: warning/multiple-constructor-doc warning/named-expr-without-context warning/nan-comparison + warning/nested-min-max warning/non-ascii-file-name warning/non-parent-init-called warning/non-str-assignment-to-dunder-name @@ -393,6 +393,7 @@ All messages in the convention category: convention/consider-using-dict-items convention/consider-using-enumerate convention/consider-using-f-string + convention/dict-init-mutate convention/disallowed-name convention/docstring-first-line-empty convention/empty-docstring @@ -502,6 +503,7 @@ All messages in the refactor category: refactor/property-with-parameters refactor/redefined-argument-from-local refactor/redefined-variable-type + refactor/redundant-typehint-argument refactor/simplifiable-condition refactor/simplifiable-if-expression refactor/simplifiable-if-statement |