diff --git a/python/pluginResources/inspectionDescriptions/CythonUsageBeforeDeclarationInspection.html b/python/pluginResources/inspectionDescriptions/CythonUsageBeforeDeclarationInspection.html index 2a8c9d48a9c7..493119f3639d 100644 --- a/python/pluginResources/inspectionDescriptions/CythonUsageBeforeDeclarationInspection.html +++ b/python/pluginResources/inspectionDescriptions/CythonUsageBeforeDeclarationInspection.html @@ -2,12 +2,12 @@

Reports Cython variables being referenced before declaration.

Example:

-
+

 cdef int c_x
 
 print(c_x, c_y)  # Variable 'c_y' is used before its declaration
 
 cdef int c_y = 0
-
+
\ No newline at end of file diff --git a/python/pluginResources/inspectionDescriptions/PyPep8NamingInspection.html b/python/pluginResources/inspectionDescriptions/PyPep8NamingInspection.html index 8d9d0e52fed1..1c5ef563def9 100644 --- a/python/pluginResources/inspectionDescriptions/PyPep8NamingInspection.html +++ b/python/pluginResources/inspectionDescriptions/PyPep8NamingInspection.html @@ -3,21 +3,21 @@

Reports violations of the PEP8 naming conventions.

Example:

-
+

 class mammalia(object):
     extremities = 4
 
     def feeds(self):
         print("milk")
-
+

In this code fragment, IDE offers to rename mammalia to Mammalia. When the quick-fix is applied, the code change to:

-
+

 class Mammalia(object):
     extremities = 4
 
     def feeds(self):
         print("milk")
-
+
\ No newline at end of file diff --git a/python/pluginResources/inspectionDescriptions/PyShadowingBuiltinsInspection.html b/python/pluginResources/inspectionDescriptions/PyShadowingBuiltinsInspection.html index d8136a8712d5..282209df01b7 100644 --- a/python/pluginResources/inspectionDescriptions/PyShadowingBuiltinsInspection.html +++ b/python/pluginResources/inspectionDescriptions/PyShadowingBuiltinsInspection.html @@ -2,11 +2,11 @@

Reports shadowing built-in names, such as len or list.

Example:

-
+

 def len(a, b, c):
     d = a + b + c
     return d
-
+

In this code fragment, the len built-in name is used. The IDE offers to apply the Rename refactoring as a fix.

diff --git a/python/pluginResources/inspectionDescriptions/PyUnresolvedReferencesInspection.html b/python/pluginResources/inspectionDescriptions/PyUnresolvedReferencesInspection.html index 8de03ef84269..138c95e689fe 100644 --- a/python/pluginResources/inspectionDescriptions/PyUnresolvedReferencesInspection.html +++ b/python/pluginResources/inspectionDescriptions/PyUnresolvedReferencesInspection.html @@ -3,10 +3,10 @@

Reports references in your code that cannot be resolved.

In a dynamically typed language, this is possible in a limited number of cases.

If a reference type is unknown, then its attributes are not highlighted as unresolved even if you know that they should be:

-
+

 def print_string(s):
   print(s.abc())
-
+

In this code fragment s is always a string and abc should be highlighted as unresolved. However, s type is inferred as Any and no warning is reported.

The IDE provides quick-fix actions to add missing references on-the-fly.

diff --git a/python/pluginResources/inspectionDescriptions/RestRoleInspection.html b/python/pluginResources/inspectionDescriptions/RestRoleInspection.html index 2b653c21df3a..54b46603813c 100644 --- a/python/pluginResources/inspectionDescriptions/RestRoleInspection.html +++ b/python/pluginResources/inspectionDescriptions/RestRoleInspection.html @@ -2,7 +2,7 @@

Reports undefined roles in reStructuredText files.

Example:

-
+

 .. role:: custom
 .. role:: newcustom(emphasis)
 
@@ -12,6 +12,6 @@ An example of using :emphasis:`interpreted text`
 
 
 Some text using undefined role :undef:`interpreted text`
-
+
\ No newline at end of file diff --git a/python/python-psi-impl/resources/inspectionDescriptions/PyAbstractClassInspection.html b/python/python-psi-impl/resources/inspectionDescriptions/PyAbstractClassInspection.html index 104e897db86f..d3e81504795a 100644 --- a/python/python-psi-impl/resources/inspectionDescriptions/PyAbstractClassInspection.html +++ b/python/python-psi-impl/resources/inspectionDescriptions/PyAbstractClassInspection.html @@ -3,7 +3,7 @@

Reports cases when not all abstract properties or methods are defined in a subclass.

Example:

-
+

 from abc import abstractmethod, ABC
 
 
@@ -17,9 +17,9 @@ class Figure(ABC):
 class Triangle(Figure):
     def do_triangle(self):
         pass
-
+

When the quick-fix is applied, the IDE implements an abstract method for the Triangle class:

-
+

 from abc import abstractmethod, ABC
 
 
@@ -36,6 +36,6 @@ class Triangle(Figure):
 
     def do_triangle(self):
         pass
-
+
\ No newline at end of file diff --git a/python/python-psi-impl/resources/inspectionDescriptions/PyArgumentEqualDefaultInspection.html b/python/python-psi-impl/resources/inspectionDescriptions/PyArgumentEqualDefaultInspection.html index 325a857ee085..81386ec27d33 100644 --- a/python/python-psi-impl/resources/inspectionDescriptions/PyArgumentEqualDefaultInspection.html +++ b/python/python-psi-impl/resources/inspectionDescriptions/PyArgumentEqualDefaultInspection.html @@ -4,12 +4,12 @@ passed to the function is equal to the default parameter value.

This inspection is disabled by default to avoid performance degradation.

Example:

-
+

 def my_function(a: int = 2):
     print(a)
 
 
 my_function(2)
-
+
\ No newline at end of file diff --git a/python/python-psi-impl/resources/inspectionDescriptions/PyArgumentListInspection.html b/python/python-psi-impl/resources/inspectionDescriptions/PyArgumentListInspection.html index ca34354b8538..20dd9e4aaf29 100644 --- a/python/python-psi-impl/resources/inspectionDescriptions/PyArgumentListInspection.html +++ b/python/python-psi-impl/resources/inspectionDescriptions/PyArgumentListInspection.html @@ -3,7 +3,7 @@

Reports discrepancies between declared parameters and actual arguments, as well as incorrect arguments, for example, duplicate named arguments, and incorrect argument order.

Example:

-
+

 class Foo:
     def __call__(self, p1: int, *, p2: str = "%"):
         return p2 * p1
@@ -12,9 +12,9 @@ class Foo:
 bar = Foo()
 bar.__call__() # unfilled parameter
 bar(5, "#") # unexpected argument
-
+

The correct code fragment looks at follows:

-
+

 class Foo:
     def __call__(self, p1: int, *, p2: str = "%"):
         return p2 * p1
@@ -23,6 +23,6 @@ class Foo:
 bar = Foo()
 bar.__call__(5)
 bar(5, p2="#")
-
+
diff --git a/python/python-psi-impl/resources/inspectionDescriptions/PyAssignmentToLoopOrWithParameterInspection.html b/python/python-psi-impl/resources/inspectionDescriptions/PyAssignmentToLoopOrWithParameterInspection.html index 4a40b4bcf5a8..dc0820a27d86 100644 --- a/python/python-psi-impl/resources/inspectionDescriptions/PyAssignmentToLoopOrWithParameterInspection.html +++ b/python/python-psi-impl/resources/inspectionDescriptions/PyAssignmentToLoopOrWithParameterInspection.html @@ -1,18 +1,19 @@ -Reports the cases when you rewrite a loop variable with an inner loop: -
+Reports the cases when you rewrite a loop variable with an inner loop.
+

Example:

+

     for i in range(5):
       for i in range(20, 25):
           print("Inner", i)
       print("Outer", i)
-  
+
-It also warns you if a variable declared in the with statement is redeclared inside of the statement body: -
+It also warns you if a variable declared in the with statement is redeclared inside the statement body:
+

     with open("file") as f:
       f.read()
       with open("file") as f:
-  
+
diff --git a/python/python-psi-impl/resources/inspectionDescriptions/PyAsyncCallInspection.html b/python/python-psi-impl/resources/inspectionDescriptions/PyAsyncCallInspection.html index 8139648180a0..18a28be02ff6 100644 --- a/python/python-psi-impl/resources/inspectionDescriptions/PyAsyncCallInspection.html +++ b/python/python-psi-impl/resources/inspectionDescriptions/PyAsyncCallInspection.html @@ -3,22 +3,22 @@

Reports coroutines that were called without using the await syntax.

Example:

-
+

 async def bar():
     pass
 
 
 async def foo():
     bar()
-
+

After the quick-fix is applied, the code changes to:

-
+

 async def bar():
     pass
 
 
 async def foo():
     await bar()
-
+
\ No newline at end of file diff --git a/python/python-psi-impl/resources/inspectionDescriptions/PyAttributeOutsideInitInspection.html b/python/python-psi-impl/resources/inspectionDescriptions/PyAttributeOutsideInitInspection.html index 53914a2dc44b..5a826724fb00 100644 --- a/python/python-psi-impl/resources/inspectionDescriptions/PyAttributeOutsideInitInspection.html +++ b/python/python-psi-impl/resources/inspectionDescriptions/PyAttributeOutsideInitInspection.html @@ -3,18 +3,18 @@ Reports a problem when instance attribute definition is outside __init__ method.

Example:

-
+

     class Book:
     def __init__(self):
         self.author = 'Mark Twain'
 
     def release(self):
         self.year = '1889'
-
+

When the quick-fix is applied, the code sample changes to:

-
+

     class Book:
     def __init__(self):
         self.year = '1889'
@@ -22,6 +22,6 @@ definition is outside __init__ method.
 
     def release(self):
         pass
-
+
\ No newline at end of file diff --git a/python/python-psi-impl/resources/inspectionDescriptions/PyAugmentAssignmentInspection.html b/python/python-psi-impl/resources/inspectionDescriptions/PyAugmentAssignmentInspection.html index e13c6a3092b9..398dddc08641 100644 --- a/python/python-psi-impl/resources/inspectionDescriptions/PyAugmentAssignmentInspection.html +++ b/python/python-psi-impl/resources/inspectionDescriptions/PyAugmentAssignmentInspection.html @@ -2,16 +2,16 @@

Reports assignments that can be replaced with augmented assignments.

Example:

-
+

 a = 23
 b = 3
 a = a + b
-
+

After the quick-fix is applied, the code changes to:

-
+

 a = 23
 b = 3
 a += b
-
+
\ No newline at end of file diff --git a/python/python-psi-impl/resources/inspectionDescriptions/PyByteLiteralInspection.html b/python/python-psi-impl/resources/inspectionDescriptions/PyByteLiteralInspection.html index d8415bce713d..96f34d50483d 100644 --- a/python/python-psi-impl/resources/inspectionDescriptions/PyByteLiteralInspection.html +++ b/python/python-psi-impl/resources/inspectionDescriptions/PyByteLiteralInspection.html @@ -2,6 +2,8 @@

Reports characters in byte literals that are outside ASCII range.

Example:

-s = b'№5' +

+  s = b'№5'
+
\ No newline at end of file diff --git a/python/python-psi-impl/resources/inspectionDescriptions/PyCallingNonCallableInspection.html b/python/python-psi-impl/resources/inspectionDescriptions/PyCallingNonCallableInspection.html index 8e72ddadf312..15b2c95ab9f5 100644 --- a/python/python-psi-impl/resources/inspectionDescriptions/PyCallingNonCallableInspection.html +++ b/python/python-psi-impl/resources/inspectionDescriptions/PyCallingNonCallableInspection.html @@ -2,12 +2,13 @@

Reports a problem when you are trying to call objects that are not callable, like, for example, properties:

-
+

Example:

+

 class Record:
     @property
     def as_json(self):
 
 json = Record().as_json()
-
+
\ No newline at end of file diff --git a/python/python-psi-impl/resources/inspectionDescriptions/PyClassHasNoInitInspection.html b/python/python-psi-impl/resources/inspectionDescriptions/PyClassHasNoInitInspection.html index 66bc769c1c36..bce74e642c33 100644 --- a/python/python-psi-impl/resources/inspectionDescriptions/PyClassHasNoInitInspection.html +++ b/python/python-psi-impl/resources/inspectionDescriptions/PyClassHasNoInitInspection.html @@ -3,15 +3,15 @@

Reports cases in Python 2 when a class has no __init__ method, neither its parent classes.

Example:

-
+

 class Book():
     pass
-
+

The quick-fix adds the __init__ method:

-
+

 class Book():
     def __init__(self):
         pass
-
+
\ No newline at end of file diff --git a/python/python-psi-impl/resources/inspectionDescriptions/PyClassVarInspection.html b/python/python-psi-impl/resources/inspectionDescriptions/PyClassVarInspection.html index 2759141c07ba..8563d7f98740 100644 --- a/python/python-psi-impl/resources/inspectionDescriptions/PyClassVarInspection.html +++ b/python/python-psi-impl/resources/inspectionDescriptions/PyClassVarInspection.html @@ -2,7 +2,7 @@

Reports invalid usages of ClassVar annotations.

Example:

-
+

 from typing import ClassVar
 
 
@@ -17,6 +17,6 @@ class Cat:
 Cat.color = "black"  # OK
 my_cat = Cat(5)
 my_cat.color = "gray"  # Error, setting class variable on instance
-
+
\ No newline at end of file diff --git a/python/python-psi-impl/resources/inspectionDescriptions/PyClassicStyleClassInspection.html b/python/python-psi-impl/resources/inspectionDescriptions/PyClassicStyleClassInspection.html index 1271936c6ded..d6a4cefd412c 100644 --- a/python/python-psi-impl/resources/inspectionDescriptions/PyClassicStyleClassInspection.html +++ b/python/python-psi-impl/resources/inspectionDescriptions/PyClassicStyleClassInspection.html @@ -3,15 +3,15 @@

Reports classic style classes usage. This inspection applies only to Python 2.

Example:

-
+

 class A:
     pass
-
+

With quick-fixes provided by the IDE, this code fragment changes to:

-
+

 class A(object):
     def __init__(self):
         pass
-
+
\ No newline at end of file diff --git a/python/python-psi-impl/resources/inspectionDescriptions/PyComparisonWithNoneInspection.html b/python/python-psi-impl/resources/inspectionDescriptions/PyComparisonWithNoneInspection.html index 1e763a84f007..66ebf264b949 100644 --- a/python/python-psi-impl/resources/inspectionDescriptions/PyComparisonWithNoneInspection.html +++ b/python/python-psi-impl/resources/inspectionDescriptions/PyComparisonWithNoneInspection.html @@ -4,20 +4,20 @@ should always be done with is or is not, never the equality operators.

Example:

-
+

 a = 2
 
 
 if a == None:
     print("Success")
-
+

Once the quick-fix is applied, the code changes to:

-
+

 a = 2
 
 
 if a is None:
     print("Success")
-
+
\ No newline at end of file diff --git a/python/python-psi-impl/resources/inspectionDescriptions/PyDataclassInspection.html b/python/python-psi-impl/resources/inspectionDescriptions/PyDataclassInspection.html index f711b5313bbf..b3798688ad29 100644 --- a/python/python-psi-impl/resources/inspectionDescriptions/PyDataclassInspection.html +++ b/python/python-psi-impl/resources/inspectionDescriptions/PyDataclassInspection.html @@ -3,7 +3,7 @@

Reports invalid definitions and usages of classes created with dataclasses or attr modules.

Example:

-
+

 import dataclasses
 
 
@@ -12,6 +12,6 @@ class FullName:
     first: str
     middle: str = ""
     last: str
-
+
\ No newline at end of file diff --git a/python/python-psi-impl/resources/inspectionDescriptions/PyDecoratorInspection.html b/python/python-psi-impl/resources/inspectionDescriptions/PyDecoratorInspection.html index d6c9bc048845..306a070600a3 100644 --- a/python/python-psi-impl/resources/inspectionDescriptions/PyDecoratorInspection.html +++ b/python/python-psi-impl/resources/inspectionDescriptions/PyDecoratorInspection.html @@ -3,7 +3,7 @@

Reports usages of @classmethod or @staticmethod decorators in methods outside a class.

Example:

-
+

 class State(object):
 
     @classmethod
@@ -14,11 +14,11 @@ class State(object):
 @classmethod
 def change_state(self):
     pass
-
+

The change_state method should not use the @classmethod decorator or it should be moved to the State class declaration.

If you apply the Remove decorator action, the code changes to:

-
+

 class State(object):
 
     @classmethod
@@ -28,6 +28,6 @@ class State(object):
 
 def change_state(self):
     pass
-
+
diff --git a/python/python-psi-impl/resources/inspectionDescriptions/PyDefaultArgumentInspection.html b/python/python-psi-impl/resources/inspectionDescriptions/PyDefaultArgumentInspection.html index fb76fc991c84..67a19c821e07 100644 --- a/python/python-psi-impl/resources/inspectionDescriptions/PyDefaultArgumentInspection.html +++ b/python/python-psi-impl/resources/inspectionDescriptions/PyDefaultArgumentInspection.html @@ -6,16 +6,16 @@ which means that modifying the default value of the argument will affect all subsequent calls of that function.

Example:

-
+

 def func(s, cache={}):
     cache[s] = None
-
+

When the quick-fix is applied, the code changes to:

-
+

 def func(s, cache=None):
     if cache is None:
         cache = {}
     cache[s] = None
-
+
\ No newline at end of file diff --git a/python/python-psi-impl/resources/inspectionDescriptions/PyDeprecationInspection.html b/python/python-psi-impl/resources/inspectionDescriptions/PyDeprecationInspection.html index ac79fe9666db..0e96cee93764 100644 --- a/python/python-psi-impl/resources/inspectionDescriptions/PyDeprecationInspection.html +++ b/python/python-psi-impl/resources/inspectionDescriptions/PyDeprecationInspection.html @@ -5,7 +5,7 @@

Also, this inspection highlights usages of abc.abstractstaticmethod, abc.abstractproperty, and abc.abstractclassmethod decorators.

Example:

-
+

 class Foo:
     @property
     def bar(self):
@@ -16,6 +16,6 @@ class Foo:
 
 foo = Foo()
 print(foo.bar)
-
+
\ No newline at end of file diff --git a/python/python-psi-impl/resources/inspectionDescriptions/PyDictCreationInspection.html b/python/python-psi-impl/resources/inspectionDescriptions/PyDictCreationInspection.html index 7c2b12555b9a..ab0395c21a33 100644 --- a/python/python-psi-impl/resources/inspectionDescriptions/PyDictCreationInspection.html +++ b/python/python-psi-impl/resources/inspectionDescriptions/PyDictCreationInspection.html @@ -4,13 +4,13 @@ by using a dictionary literal.

This approach brings performance improvements.

Example:

-
+

 dic = {}
 dic['var'] = 1
-
+

When the quick-fix is applied, the code changes to:

-
+

 dic = {'var': 1}
-
+
\ No newline at end of file diff --git a/python/python-psi-impl/resources/inspectionDescriptions/PyDictDuplicateKeysInspection.html b/python/python-psi-impl/resources/inspectionDescriptions/PyDictDuplicateKeysInspection.html index 9c8f20ad3346..1c3da24539f9 100644 --- a/python/python-psi-impl/resources/inspectionDescriptions/PyDictDuplicateKeysInspection.html +++ b/python/python-psi-impl/resources/inspectionDescriptions/PyDictDuplicateKeysInspection.html @@ -2,8 +2,8 @@

Reports using the same value as the dictionary key twice.

Example:

-
+

 dic = {"a": [1, 2], "a": [3, 4]}
-
+
\ No newline at end of file diff --git a/python/python-psi-impl/resources/inspectionDescriptions/PyDunderSlotsInspection.html b/python/python-psi-impl/resources/inspectionDescriptions/PyDunderSlotsInspection.html index 71873424d4bd..25592e157d61 100644 --- a/python/python-psi-impl/resources/inspectionDescriptions/PyDunderSlotsInspection.html +++ b/python/python-psi-impl/resources/inspectionDescriptions/PyDunderSlotsInspection.html @@ -2,13 +2,13 @@

Reports invalid usages of a class with __slots__ definitions.

Example:

-
+

 class Foo:
     __slots__ = ['foo', 'bar']
 
 
 foo = Foo()
 foo.baz = 'spam'
-
+
\ No newline at end of file diff --git a/python/python-psi-impl/resources/inspectionDescriptions/PyExceptClausesOrderInspection.html b/python/python-psi-impl/resources/inspectionDescriptions/PyExceptClausesOrderInspection.html index 20abca4c9265..17c17607c1db 100644 --- a/python/python-psi-impl/resources/inspectionDescriptions/PyExceptClausesOrderInspection.html +++ b/python/python-psi-impl/resources/inspectionDescriptions/PyExceptClausesOrderInspection.html @@ -6,22 +6,22 @@ If you do not fix the order, some exceptions may not be caught by the most specific handler.

Example:

-
+

 try:
     call()
 except ValueError:
     pass
 except UnicodeError:
     pass
-
+

The IDE recommends moving the clause up. When the quick-fix is applied, the code changes to:

-
+

 try:
     call()
 except UnicodeError:
     pass
 except ValueError:
     pass
-
+
\ No newline at end of file diff --git a/python/python-psi-impl/resources/inspectionDescriptions/PyExceptionInheritInspection.html b/python/python-psi-impl/resources/inspectionDescriptions/PyExceptionInheritInspection.html index 37a994a1275b..e3d47d008060 100644 --- a/python/python-psi-impl/resources/inspectionDescriptions/PyExceptionInheritInspection.html +++ b/python/python-psi-impl/resources/inspectionDescriptions/PyExceptionInheritInspection.html @@ -4,22 +4,22 @@ raised but does not inherit from the builtin Exception class.

Example:

-
+

 class A:
     pass
 
 
 def me_exception():
     raise A()
-
+

The proposed quick-fix changes the code to:

-
+

 class A(Exception):
     pass
 
 
 def me_exception():
     raise A()
-
+
\ No newline at end of file diff --git a/python/python-psi-impl/resources/inspectionDescriptions/PyFinalInspection.html b/python/python-psi-impl/resources/inspectionDescriptions/PyFinalInspection.html index 2dbcd4afd183..97ca09792828 100644 --- a/python/python-psi-impl/resources/inspectionDescriptions/PyFinalInspection.html +++ b/python/python-psi-impl/resources/inspectionDescriptions/PyFinalInspection.html @@ -3,7 +3,7 @@

Reports invalid usages of final classes, methods and variables.

Example:

-
+

 from typing import final
 
 
@@ -16,6 +16,6 @@ class A:
 class B(A):
     def a_method(self):
         pass
-
+
\ No newline at end of file diff --git a/python/python-psi-impl/resources/inspectionDescriptions/PyFromFutureImportInspection.html b/python/python-psi-impl/resources/inspectionDescriptions/PyFromFutureImportInspection.html index d92ff307b12d..61407d33965c 100644 --- a/python/python-psi-impl/resources/inspectionDescriptions/PyFromFutureImportInspection.html +++ b/python/python-psi-impl/resources/inspectionDescriptions/PyFromFutureImportInspection.html @@ -4,17 +4,17 @@ statements that are used not at the beginning of a file.

Example:

-
+

 a = 1
 from __future__ import print_function
 print()
-
+

When the quick-fix is applied, the code changes to:

-
+

 from __future__ import print_function
 
 a = 1
 print()
-
+
\ No newline at end of file diff --git a/python/python-psi-impl/resources/inspectionDescriptions/PyGlobalUndefinedInspection.html b/python/python-psi-impl/resources/inspectionDescriptions/PyGlobalUndefinedInspection.html index 2a22c2828a3e..57d158d12452 100644 --- a/python/python-psi-impl/resources/inspectionDescriptions/PyGlobalUndefinedInspection.html +++ b/python/python-psi-impl/resources/inspectionDescriptions/PyGlobalUndefinedInspection.html @@ -3,20 +3,20 @@

Reports problems when a variable defined through the global statement is not defined in the module scope.

Example:

-
+

 def foo():
     global bar
     print(bar)
 
 foo()
-
+

As a fix, you can move the global variable declaration:

-
+

 global bar
 
 
 def foo():
     print(bar)
-
+
\ No newline at end of file diff --git a/python/python-psi-impl/resources/inspectionDescriptions/PyIncorrectDocstringInspection.html b/python/python-psi-impl/resources/inspectionDescriptions/PyIncorrectDocstringInspection.html index 3838061645f7..61cfde4d0e1e 100644 --- a/python/python-psi-impl/resources/inspectionDescriptions/PyIncorrectDocstringInspection.html +++ b/python/python-psi-impl/resources/inspectionDescriptions/PyIncorrectDocstringInspection.html @@ -2,7 +2,7 @@

Reports mismatched parameters in a docstring. For example, b is highlighted, because there is no such a parameter in the add function.

-
+

     def add(a, c):
     """
     @param a:
@@ -10,14 +10,14 @@
     @return:
     """
     pass
-
+

The inspection does not warn you of missing parameters if none of them is mentioned in a docstring:

-
+

 def mult(a, c):
     """
     @return:
     """
     pass
-
+
\ No newline at end of file diff --git a/python/python-psi-impl/resources/inspectionDescriptions/PyInitNewSignatureInspection.html b/python/python-psi-impl/resources/inspectionDescriptions/PyInitNewSignatureInspection.html index 633aa4440432..e8c94e195100 100644 --- a/python/python-psi-impl/resources/inspectionDescriptions/PyInitNewSignatureInspection.html +++ b/python/python-psi-impl/resources/inspectionDescriptions/PyInitNewSignatureInspection.html @@ -2,14 +2,14 @@

Reports incompatible signatures of the __new__ and __init__ methods.

Example:

-
+

 class MyClass(object):
     def __new__(cls, arg1):
         return super().__new__(cls)
 
     def __init__(self):
         pass
-
+

If the __new__ and __init__ have different arguments, then the MyClass cannot be instantiated.

As a fix, the IDE offers to apply the Change Signature refactoring.

diff --git a/python/python-psi-impl/resources/inspectionDescriptions/PyListCreationInspection.html b/python/python-psi-impl/resources/inspectionDescriptions/PyListCreationInspection.html index 611d10d319ac..f45fb6057782 100644 --- a/python/python-psi-impl/resources/inspectionDescriptions/PyListCreationInspection.html +++ b/python/python-psi-impl/resources/inspectionDescriptions/PyListCreationInspection.html @@ -4,13 +4,13 @@ can be rewritten with a list literal.

This ensures better performance of your application.

Example:

-
+

 l = [1]
 l.append(2)
-
+

When the quick-fix is applied, the code changes to:

-
+

 l = [1, 2]
-
+
\ No newline at end of file diff --git a/python/python-psi-impl/resources/inspectionDescriptions/PyMandatoryEncodingInspection.html b/python/python-psi-impl/resources/inspectionDescriptions/PyMandatoryEncodingInspection.html index 539a0073cfab..f5807c657575 100644 --- a/python/python-psi-impl/resources/inspectionDescriptions/PyMandatoryEncodingInspection.html +++ b/python/python-psi-impl/resources/inspectionDescriptions/PyMandatoryEncodingInspection.html @@ -2,17 +2,17 @@

Reports a missing encoding comment in Python 2.

Example:

-
+

 class Book(object):
     def __init__(self):
         pass
-
+

When the quick-fix is applied, the missing comment is added:

-
+

 # coding=utf-8
 class Book(object):
     def __init__(self):
         pass
-
+
\ No newline at end of file diff --git a/python/python-psi-impl/resources/inspectionDescriptions/PyMethodFirstArgAssignmentInspection.html b/python/python-psi-impl/resources/inspectionDescriptions/PyMethodFirstArgAssignmentInspection.html index 78ddaf7ba923..baab0f218925 100644 --- a/python/python-psi-impl/resources/inspectionDescriptions/PyMethodFirstArgAssignmentInspection.html +++ b/python/python-psi-impl/resources/inspectionDescriptions/PyMethodFirstArgAssignmentInspection.html @@ -5,13 +5,13 @@ Because in most cases, there are no objectives in such reassignment, the IDE indicates an error.

Example:

-
+

 class Account:
     def calc(self, balance):
         if balance == 0:
             self = balance
         return self
-
+

As a fix, you might want to check and modify the algorithm to ensure that reassignment is needed. If everything is correct, you can invoke intention actions for this code and opt to ignore the warning.

diff --git a/python/python-psi-impl/resources/inspectionDescriptions/PyMethodMayBeStaticInspection.html b/python/python-psi-impl/resources/inspectionDescriptions/PyMethodMayBeStaticInspection.html index e6b47bca084f..f82235f3a388 100644 --- a/python/python-psi-impl/resources/inspectionDescriptions/PyMethodMayBeStaticInspection.html +++ b/python/python-psi-impl/resources/inspectionDescriptions/PyMethodMayBeStaticInspection.html @@ -3,26 +3,26 @@

Reports any methods that do not require a class instance creation and can be made static.

Example:

-
+

 class MyClass(object):
     def my_method(self, x):
         print(x)
-
+

If a Make function from method quick-fix is applied, the code changes to:

-
+

 def my_method(x):
     print(x)
 
 
 class MyClass(object):
     pass
-
+

If you select the Make method static quick-fix, the @staticmethod decorator is added:

-
+

 class MyClass(object):
     @staticmethod
     def my_method(x):
         print(x)
-
+
\ No newline at end of file diff --git a/python/python-psi-impl/resources/inspectionDescriptions/PyMethodOverridingInspection.html b/python/python-psi-impl/resources/inspectionDescriptions/PyMethodOverridingInspection.html index 47c072bbaac1..de2e144a0526 100644 --- a/python/python-psi-impl/resources/inspectionDescriptions/PyMethodOverridingInspection.html +++ b/python/python-psi-impl/resources/inspectionDescriptions/PyMethodOverridingInspection.html @@ -3,7 +3,7 @@

Reports inconsistencies in overriding method signatures.

Example:

-
+

 class Book:
     def add_title(self):
         pass
@@ -12,7 +12,7 @@ class Book:
 class Novel(Book):
     def add_title(self, text):
         pass
-
+

Parameters of the add_title method in the Novel class do not match the method signature specified in the Book class. As a fix, the IDE offers to apply the Change Signature diff --git a/python/python-psi-impl/resources/inspectionDescriptions/PyMethodParametersInspection.html b/python/python-psi-impl/resources/inspectionDescriptions/PyMethodParametersInspection.html index 61df51dc92e4..05f8e76f62d1 100644 --- a/python/python-psi-impl/resources/inspectionDescriptions/PyMethodParametersInspection.html +++ b/python/python-psi-impl/resources/inspectionDescriptions/PyMethodParametersInspection.html @@ -3,27 +3,27 @@

Reports methods that lack the first parameter that is usually named self.

Example:

-
+

 class Movie:
 
    def show():
        pass
-
+

When the quick-fix is applied, the code changes to:

-
+

 class Movie:
 
    def show(self):
        pass
-
+

The inspection also reports naming issues in class methods.

Example:

-
+

 class Movie:
     @classmethod
     def show(abc):
         pass
-
+

Since the first parameter of a class method should be cls, the IDE provides a quick-fix to rename it.

diff --git a/python/python-psi-impl/resources/inspectionDescriptions/PyMissingConstructorInspection.html b/python/python-psi-impl/resources/inspectionDescriptions/PyMissingConstructorInspection.html index d40d5d3be9cc..8be6e7e1f84b 100644 --- a/python/python-psi-impl/resources/inspectionDescriptions/PyMissingConstructorInspection.html +++ b/python/python-psi-impl/resources/inspectionDescriptions/PyMissingConstructorInspection.html @@ -2,7 +2,7 @@

Reports cases when a call to the super constructor in a class is missed.

Example:

-
+

 class Fruit:
     def __init__(self):
         pass
@@ -11,11 +11,11 @@ class Fruit:
 class Pear(Fruit):
     def __init__(self):
         pass
-
+

The Pear class should have a super call in the __init__ method.

When the quick-fix is applied, the code changes to:

-
+

 class Fruit:
     def __init__(self):
         pass
@@ -24,6 +24,6 @@ class Fruit:
 class Pear(Fruit):
     def __init__(self):
         super().__init__()
-
+
\ No newline at end of file diff --git a/python/python-psi-impl/resources/inspectionDescriptions/PyMissingOrEmptyDocstringInspection.html b/python/python-psi-impl/resources/inspectionDescriptions/PyMissingOrEmptyDocstringInspection.html index 6761a9053e87..cdd90fb7413f 100644 --- a/python/python-psi-impl/resources/inspectionDescriptions/PyMissingOrEmptyDocstringInspection.html +++ b/python/python-psi-impl/resources/inspectionDescriptions/PyMissingOrEmptyDocstringInspection.html @@ -2,26 +2,26 @@

Reports missing and empty docstrings.

Example of a missing docstring

-
+

 def demo(a):
     c = a ** 2
-
+

Example of an empty docstring

-
+

 def demo(a):
     """
     """
     c = a ** 2
-
+

When the quick-fix is applied, the code fragments change to:

-
+

 def demo(a):
     """
 
     :param a:
     """
     c = a ** 2
-
+

You need to provide some details about the parameter in the generated template.

\ No newline at end of file diff --git a/python/python-psi-impl/resources/inspectionDescriptions/PyNamedTupleInspection.html b/python/python-psi-impl/resources/inspectionDescriptions/PyNamedTupleInspection.html index b9d20cea54f6..d521cd233b49 100644 --- a/python/python-psi-impl/resources/inspectionDescriptions/PyNamedTupleInspection.html +++ b/python/python-psi-impl/resources/inspectionDescriptions/PyNamedTupleInspection.html @@ -3,7 +3,7 @@

Reports invalid definition of a typing.NamedTuple.

Example:

-
+

 import typing
 
 
@@ -11,9 +11,9 @@ class FullName(typing.NamedTuple):
     first: str
     last: str = ""
     middle: str
-
+

As a fix, place the field with the default value after the fields without default values:

-
+

 import typing
 
 
@@ -21,6 +21,6 @@ class FullName(typing.NamedTuple):
     first: str
     middle: str
     last: str = ""
-
+
\ No newline at end of file diff --git a/python/python-psi-impl/resources/inspectionDescriptions/PyNestedDecoratorsInspection.html b/python/python-psi-impl/resources/inspectionDescriptions/PyNestedDecoratorsInspection.html index eafe712e20e2..c10228fb5312 100644 --- a/python/python-psi-impl/resources/inspectionDescriptions/PyNestedDecoratorsInspection.html +++ b/python/python-psi-impl/resources/inspectionDescriptions/PyNestedDecoratorsInspection.html @@ -3,7 +3,7 @@

Reports problems with nesting decorators. The inspection highlights the cases when classmethod or staticmethod is applied before another decorator.

Example:

-
+

 def innocent(f):
     return f
 
@@ -18,7 +18,7 @@ class A:
     @staticmethod
     def f1():
         pass
-
+

As a quick-fix, the IDE offers to remove the decorator.

\ No newline at end of file diff --git a/python/python-psi-impl/resources/inspectionDescriptions/PyNonAsciiCharInspection.html b/python/python-psi-impl/resources/inspectionDescriptions/PyNonAsciiCharInspection.html index 72afad76733f..c26a10d1dec8 100644 --- a/python/python-psi-impl/resources/inspectionDescriptions/PyNonAsciiCharInspection.html +++ b/python/python-psi-impl/resources/inspectionDescriptions/PyNonAsciiCharInspection.html @@ -3,20 +3,20 @@

Reports cases in Python 2 when a file contains non-ASCII characters and does not have an encoding declaration at the top.

Example:

-
+

 class A(object):
 # №5
     def __init__(self):
         pass
-
+

In this example, the IDE reports a non-ASCII symbol in a comment and a lack of encoding declaration. Apply the proposed quick-fix to add a missing encoding declaration:

-
+

 # coding=utf-8
 class A(object)
 # №5
     def __init__(self):
         pass
-
+
\ No newline at end of file diff --git a/python/python-psi-impl/resources/inspectionDescriptions/PyNoneFunctionAssignmentInspection.html b/python/python-psi-impl/resources/inspectionDescriptions/PyNoneFunctionAssignmentInspection.html index 2e8810a9ce18..8847d49a5885 100644 --- a/python/python-psi-impl/resources/inspectionDescriptions/PyNoneFunctionAssignmentInspection.html +++ b/python/python-psi-impl/resources/inspectionDescriptions/PyNoneFunctionAssignmentInspection.html @@ -2,15 +2,14 @@

Reports cases when an assignment is done on a function that does not return anything.

This inspection is similar to pylint inspection E1111. -

Example:

-
+

 def just_print():
     print("Hello!")
 
 
 action = just_print()
-
+

As a quick-fix, the IDE offers to remove the assignment.

\ No newline at end of file diff --git a/python/python-psi-impl/resources/inspectionDescriptions/PyOverloadsInspection.html b/python/python-psi-impl/resources/inspectionDescriptions/PyOverloadsInspection.html index 8f472e2d9c50..06abaadd7fbf 100644 --- a/python/python-psi-impl/resources/inspectionDescriptions/PyOverloadsInspection.html +++ b/python/python-psi-impl/resources/inspectionDescriptions/PyOverloadsInspection.html @@ -3,7 +3,7 @@

Reports cases when overloads in regular Python files are placed after the implementation or when their signatures are not compatible with the implementation.

Example:

-
+

 from typing import overload
 
 
@@ -19,6 +19,6 @@ def foo(p1): # Overload signature is not compatible with the implementation
 
 def foo(p1, p2, p3):
     print(p1, p2, p3)
-
+
\ No newline at end of file diff --git a/python/python-psi-impl/resources/inspectionDescriptions/PyPropertyAccessInspection.html b/python/python-psi-impl/resources/inspectionDescriptions/PyPropertyAccessInspection.html index 0b4855b27725..f27d325803bf 100644 --- a/python/python-psi-impl/resources/inspectionDescriptions/PyPropertyAccessInspection.html +++ b/python/python-psi-impl/resources/inspectionDescriptions/PyPropertyAccessInspection.html @@ -7,7 +7,7 @@ Reports cases when properties are accessed inappropriately:
  • Non-deletable properties are deleted
  • Example:

    -
    +
    
     class MyClass:
         @property
         def read_only(self): return None
    @@ -21,6 +21,6 @@ a = MyClass()
     a.read_only = 10 # property cannot be set
     del a.read_only # property cannot be deleted
     print(a.write_only) # property cannot be read
    -
    +
    \ No newline at end of file diff --git a/python/python-psi-impl/resources/inspectionDescriptions/PyPropertyDefinitionInspection.html b/python/python-psi-impl/resources/inspectionDescriptions/PyPropertyDefinitionInspection.html index 47bea9cb35e8..4e355186ff4b 100644 --- a/python/python-psi-impl/resources/inspectionDescriptions/PyPropertyDefinitionInspection.html +++ b/python/python-psi-impl/resources/inspectionDescriptions/PyPropertyDefinitionInspection.html @@ -2,7 +2,7 @@

    Reports problems with the arguments of property() and functions annotated with @property.

    -
    +
    
     class C:
         @property
         def abc(self):  # Getter should return or yield something
    @@ -19,7 +19,7 @@ class C:
         @abc.deleter
         def abc(self, v1):  # Delete signature should be (self)
             pass
    -
    +

    A quick-fix offers to update parameters.

    \ No newline at end of file diff --git a/python/python-psi-impl/resources/inspectionDescriptions/PyProtectedMemberInspection.html b/python/python-psi-impl/resources/inspectionDescriptions/PyProtectedMemberInspection.html index 75908a07f08b..6a8984993c47 100644 --- a/python/python-psi-impl/resources/inspectionDescriptions/PyProtectedMemberInspection.html +++ b/python/python-psi-impl/resources/inspectionDescriptions/PyProtectedMemberInspection.html @@ -2,7 +2,8 @@

    Reports cases when a protected member is accessed outside the class, a descendant of the class where it is defined, or a module.

    -
    +

    Example:

    +
    
     class Foo:
         def _protected_method(self):
             pass
    @@ -15,6 +16,6 @@ class Bar(Foo):
     
     foo = Foo()
     foo._protected_method() # Access to a protected method
    -
    +
    \ No newline at end of file diff --git a/python/python-psi-impl/resources/inspectionDescriptions/PyProtocolInspection.html b/python/python-psi-impl/resources/inspectionDescriptions/PyProtocolInspection.html index 32b7a063e608..7d481d183e96 100644 --- a/python/python-psi-impl/resources/inspectionDescriptions/PyProtocolInspection.html +++ b/python/python-psi-impl/resources/inspectionDescriptions/PyProtocolInspection.html @@ -3,7 +3,7 @@

    Reports invalid definitions and usages of protocols introduced in PEP-544.

    Example:

    -
    +
    
     from typing import Protocol
     
     
    @@ -20,6 +20,6 @@ class MyClass(MyProtocol):
     class MyAnotherProtocol(MyClass, Protocol): # All bases of a protocol must be protocols
         pass
     
    -
    +
    \ No newline at end of file diff --git a/python/python-psi-impl/resources/inspectionDescriptions/PyRedeclarationInspection.html b/python/python-psi-impl/resources/inspectionDescriptions/PyRedeclarationInspection.html index 28577a52939e..66844743b958 100644 --- a/python/python-psi-impl/resources/inspectionDescriptions/PyRedeclarationInspection.html +++ b/python/python-psi-impl/resources/inspectionDescriptions/PyRedeclarationInspection.html @@ -2,12 +2,12 @@

    Reports unconditional redeclarations of names without being used in between.

    Example:

    -
    +
    
     def x(): pass
     
     
     x = 2
    -
    +

    It applies to function and class declarations, and top-level assignments.

    When the warning is shown, you can try a recommended action, for example, you might be prompted to rename the variable.

    diff --git a/python/python-psi-impl/resources/inspectionDescriptions/PyReturnFromInitInspection.html b/python/python-psi-impl/resources/inspectionDescriptions/PyReturnFromInitInspection.html index f8919f539e05..d997343e5ac9 100644 --- a/python/python-psi-impl/resources/inspectionDescriptions/PyReturnFromInitInspection.html +++ b/python/python-psi-impl/resources/inspectionDescriptions/PyReturnFromInitInspection.html @@ -5,14 +5,14 @@ __init__ methods of classes.

    Example:

    -
    +
    
     class Sum:
         def __init__(self, a, b):
             self.a = a
             self.b = b
             self.sum = a + b
             return self.sum
    -
    +

    A constructor should not return any value. The __init__ method should only initialize the values of instance members for news objects.

    As a quick-fix, the IDE offers to remove the return statement.

    diff --git a/python/python-psi-impl/resources/inspectionDescriptions/PySetFunctionToLiteralInspection.html b/python/python-psi-impl/resources/inspectionDescriptions/PySetFunctionToLiteralInspection.html index 918392a39c05..d687fb225f41 100644 --- a/python/python-psi-impl/resources/inspectionDescriptions/PySetFunctionToLiteralInspection.html +++ b/python/python-psi-impl/resources/inspectionDescriptions/PySetFunctionToLiteralInspection.html @@ -3,16 +3,16 @@

    Reports calls to the set function that can be replaced with the set literal.

    Example:

    -
    +
    
     def do_mult(a, b):
         c = a * b
         return set([c, a, b])
    -
    +

    When the quick-fix is applied, the code changes to:

    -
    +
    
     def do_mult(a, b):
         c = a * b
         return {c, a, b}
    -
    +
    \ No newline at end of file diff --git a/python/python-psi-impl/resources/inspectionDescriptions/PyShadowingNamesInspection.html b/python/python-psi-impl/resources/inspectionDescriptions/PyShadowingNamesInspection.html index e3517a64a3bc..88b7d3f85b0d 100644 --- a/python/python-psi-impl/resources/inspectionDescriptions/PyShadowingNamesInspection.html +++ b/python/python-psi-impl/resources/inspectionDescriptions/PyShadowingNamesInspection.html @@ -2,11 +2,11 @@

    Reports shadowing names defined in outer scopes.

    Example:

    -
    +
    
     def outer(p):
         def inner(p):
             pass
    -
    +

    As a quick-fix, the IDE offers to remove a parameter or rename it.

    \ No newline at end of file diff --git a/python/python-psi-impl/resources/inspectionDescriptions/PySimplifyBooleanCheckInspection.html b/python/python-psi-impl/resources/inspectionDescriptions/PySimplifyBooleanCheckInspection.html index 9ebaa14f21a3..bd91f8057a29 100644 --- a/python/python-psi-impl/resources/inspectionDescriptions/PySimplifyBooleanCheckInspection.html +++ b/python/python-psi-impl/resources/inspectionDescriptions/PySimplifyBooleanCheckInspection.html @@ -2,16 +2,16 @@

    Reports equality comparison with a boolean literal.

    Example:

    -
    +
    
     def func(s):
         if s.isdigit() == True:
             return int(s)
    -
    +

    With the quick-fix applied, the code fragment will be simplified to:

    -
    +
    
     def func(s):
         if s.isdigit():
             return int(s)
    -
    +
    \ No newline at end of file diff --git a/python/python-psi-impl/resources/inspectionDescriptions/PySingleQuotedDocstringInspection.html b/python/python-psi-impl/resources/inspectionDescriptions/PySingleQuotedDocstringInspection.html index c33db5b5153d..3e67ae9ad107 100644 --- a/python/python-psi-impl/resources/inspectionDescriptions/PySingleQuotedDocstringInspection.html +++ b/python/python-psi-impl/resources/inspectionDescriptions/PySingleQuotedDocstringInspection.html @@ -2,16 +2,16 @@

    Reports docstrings that do not adhere to the triple double-quoted string format.

    Example:

    -
    +
    
     def calc(self, balance=0):
         'param: balance'
         self.balance = balance
    -
    +

    When the quick-fix is applied, the code changes to:

    -
    +
    
     def calc(self, balance=0):
         """param: balance"""
         self.balance = balance
    -
    +
    \ No newline at end of file diff --git a/python/python-psi-impl/resources/inspectionDescriptions/PyStatementEffectInspection.html b/python/python-psi-impl/resources/inspectionDescriptions/PyStatementEffectInspection.html index 4b183ca123ce..378444ce06ea 100644 --- a/python/python-psi-impl/resources/inspectionDescriptions/PyStatementEffectInspection.html +++ b/python/python-psi-impl/resources/inspectionDescriptions/PyStatementEffectInspection.html @@ -2,14 +2,14 @@

    Reports statements that have no effect.

    Example:

    -
    +
    
     class Car:
         def __init__(self, speed=0):
             self.speed = speed
             self.time # has no effect
     
     2 + 3 # has no effect
    -
    +

    In this example, you can either add a field time to the Car class or introduce variables for the problematic statements.

    diff --git a/python/python-psi-impl/resources/inspectionDescriptions/PyStringFormatInspection.html b/python/python-psi-impl/resources/inspectionDescriptions/PyStringFormatInspection.html index b0456f8c4edd..ae0f61d54308 100644 --- a/python/python-psi-impl/resources/inspectionDescriptions/PyStringFormatInspection.html +++ b/python/python-psi-impl/resources/inspectionDescriptions/PyStringFormatInspection.html @@ -2,17 +2,17 @@

    Reports errors in string formatting operations.

    Example 1:

    -
    +
    
     "Hello {1}".format("people")
    -
    +

    Example 2:

    -
    +
    
     def bar():
         return 1
     
     
     "%s %s" % bar()
    -
    +

    As a fix, you need to rewrite string formatting fragments to adhere to the formatting syntax.

    diff --git a/python/python-psi-impl/resources/inspectionDescriptions/PySuperArgumentsInspection.html b/python/python-psi-impl/resources/inspectionDescriptions/PySuperArgumentsInspection.html index af5db2fbd46d..4814cd39e40e 100644 --- a/python/python-psi-impl/resources/inspectionDescriptions/PySuperArgumentsInspection.html +++ b/python/python-psi-impl/resources/inspectionDescriptions/PySuperArgumentsInspection.html @@ -7,7 +7,7 @@
  • B a subclass of A
  • Example:

    -
    +
    
     class Figure:
         def color(self):
             pass
    @@ -21,7 +21,7 @@ class Rectangle(Figure):
     class Square(Figure):
         def color(self):
             return super(Rectangle, self).color() # Square is not an instance or subclass of Rectangle
    -
    +

    As a fix, you can make the Square an instance of the Rectangle class.

    \ No newline at end of file diff --git a/python/python-psi-impl/resources/inspectionDescriptions/PyTrailingSemicolonInspection.html b/python/python-psi-impl/resources/inspectionDescriptions/PyTrailingSemicolonInspection.html index 185e0b16a46b..a8ee6db8c0dc 100644 --- a/python/python-psi-impl/resources/inspectionDescriptions/PyTrailingSemicolonInspection.html +++ b/python/python-psi-impl/resources/inspectionDescriptions/PyTrailingSemicolonInspection.html @@ -2,17 +2,17 @@

    Reports trailing semicolons in statements.

    Example:

    -
    +
    
     def my_func(a):
         c = a ** 2;
         return c
    -
    +

    IDE provides a quick-fix that removes a trailing semicolon. When you apply it, the code changes to:

    -
    +
    
     def my_func(a):
         c = a ** 2
         return c
    -
    +
    diff --git a/python/python-psi-impl/resources/inspectionDescriptions/PyTupleAssignmentBalanceInspection.html b/python/python-psi-impl/resources/inspectionDescriptions/PyTupleAssignmentBalanceInspection.html index e9529749de37..b13d889b354f 100644 --- a/python/python-psi-impl/resources/inspectionDescriptions/PyTupleAssignmentBalanceInspection.html +++ b/python/python-psi-impl/resources/inspectionDescriptions/PyTupleAssignmentBalanceInspection.html @@ -3,10 +3,10 @@

    Reports cases when the number of expressions on the right-hand side and targets on the left-hand side are not the same.

    Example:

    -
    +
    
     t = ('red', 'blue', 'green', 'white')
     (c1, c2, c3) = t
    -
    +

    As a quick-fix, you can modify the highlighted code fragment to restore the tuple balance.

    diff --git a/python/python-psi-impl/resources/inspectionDescriptions/PyTupleItemAssignmentInspection.html b/python/python-psi-impl/resources/inspectionDescriptions/PyTupleItemAssignmentInspection.html index 69522c28f51f..598a0e6a2bbd 100644 --- a/python/python-psi-impl/resources/inspectionDescriptions/PyTupleItemAssignmentInspection.html +++ b/python/python-psi-impl/resources/inspectionDescriptions/PyTupleItemAssignmentInspection.html @@ -1,10 +1,11 @@

    Reports assignments to a tuple item.

    -
    +

    Example:

    +
    
     t = ('red', 'blue', 'green', 'white')
     t[3] = 'black'
    -
    +

    A quick-fix offers to replace the tuple with a list.

    \ No newline at end of file diff --git a/python/python-psi-impl/resources/inspectionDescriptions/PyTypeCheckerInspection.html b/python/python-psi-impl/resources/inspectionDescriptions/PyTypeCheckerInspection.html index 9929ebd029f4..16677cefe50f 100644 --- a/python/python-psi-impl/resources/inspectionDescriptions/PyTypeCheckerInspection.html +++ b/python/python-psi-impl/resources/inspectionDescriptions/PyTypeCheckerInspection.html @@ -4,22 +4,22 @@

    Types of function parameters can be specified in docstrings or in Python 3 function annotations.

    Example:

    -
    +
    
     def foo() -> int:
         return "abc" # Expected int, got str
     
     
     a: str
     a = foo() # Expected str, got int
    -
    +

    With the quick-fix, you can modify the problematic types:

    -
    +
    
     def foo() -> str:
         return "abc"
     
     
     a: str
     a = foo()
    -
    +
    diff --git a/python/python-psi-impl/resources/inspectionDescriptions/PyTypeHintsInspection.html b/python/python-psi-impl/resources/inspectionDescriptions/PyTypeHintsInspection.html index ccad59dcb748..7a0b4fbbc160 100644 --- a/python/python-psi-impl/resources/inspectionDescriptions/PyTypeHintsInspection.html +++ b/python/python-psi-impl/resources/inspectionDescriptions/PyTypeHintsInspection.html @@ -2,7 +2,7 @@

    Reports invalid usages of type hints.

    Example:

    -
    +
    
     from typing import TypeVar
     
     T0 = TypeVar('T1') # Argument of 'TypeVar' must be 'T0'
    @@ -16,7 +16,7 @@ def b(p: int) -> int:  # Type specified both in a comment and annotation
     def c(p1, p2): # Type signature has too many arguments
         # type: (int) -> int
         pass
    -
    +

    Available quick-fixes offer various actions. You can rename, remove, or move problematic elements. You can also manually modify type declarations to ensure no warning is shown.

    \ No newline at end of file diff --git a/python/python-psi-impl/resources/inspectionDescriptions/PyTypedDictInspection.html b/python/python-psi-impl/resources/inspectionDescriptions/PyTypedDictInspection.html index dc1186d5bc9d..83e4d74f1ba7 100644 --- a/python/python-psi-impl/resources/inspectionDescriptions/PyTypedDictInspection.html +++ b/python/python-psi-impl/resources/inspectionDescriptions/PyTypedDictInspection.html @@ -3,7 +3,7 @@

    Reports invalid definition and usage of TypedDict.

    Example:

    -
    +
    
     from typing import TypedDict
     
     
    @@ -20,6 +20,6 @@ m = Movie(name="name", year=1000, rate=9)
     print(m["director"])  # There is no the 'director' key in 'Movie'
     del m["name"]  # The 'name' key cannot be deleted
     m["year"] = "1001"  # Expected 'int', got 'str'
    -
    +
    \ No newline at end of file diff --git a/python/python-psi-impl/resources/inspectionDescriptions/PyUnboundLocalVariableInspection.html b/python/python-psi-impl/resources/inspectionDescriptions/PyUnboundLocalVariableInspection.html index 08b769d90c55..12b9f2d7ffda 100644 --- a/python/python-psi-impl/resources/inspectionDescriptions/PyUnboundLocalVariableInspection.html +++ b/python/python-psi-impl/resources/inspectionDescriptions/PyUnboundLocalVariableInspection.html @@ -2,18 +2,18 @@

    Reports local variables referenced before assignment.

    Example:

    -
    +
    
     x = 0
     if x > 10:
         b = 3
     print(b)
    -
    +

    The IDE reports a problem for print(b). A possible fix is:

    -
    +
    
     x = 0
     if x > 10:
         b = 3
         print(b)
    -
    +
    \ No newline at end of file diff --git a/python/python-psi-impl/resources/inspectionDescriptions/PyUnnecessaryBackslashInspection.html b/python/python-psi-impl/resources/inspectionDescriptions/PyUnnecessaryBackslashInspection.html index b26a4fabd4d7..578563c79589 100644 --- a/python/python-psi-impl/resources/inspectionDescriptions/PyUnnecessaryBackslashInspection.html +++ b/python/python-psi-impl/resources/inspectionDescriptions/PyUnnecessaryBackslashInspection.html @@ -3,10 +3,10 @@

    Reports backslashes in places where line continuation is implicit inside (), [], and {}.

    Example:

    -
    +
    
     a = ('first', \
          'second', 'third')
    -
    +

    When the quick-fix is applied, the redundant backslash is deleted.

    \ No newline at end of file diff --git a/python/python-psi-impl/resources/inspectionDescriptions/PyUnreachableCodeInspection.html b/python/python-psi-impl/resources/inspectionDescriptions/PyUnreachableCodeInspection.html index 6226c2000048..b5047a645ae0 100644 --- a/python/python-psi-impl/resources/inspectionDescriptions/PyUnreachableCodeInspection.html +++ b/python/python-psi-impl/resources/inspectionDescriptions/PyUnreachableCodeInspection.html @@ -2,12 +2,12 @@

    Reports code fragments that cannot be normally reached.

    Example:

    -
    +
    
     if True:
         print('Yes')
     else:
         print('No')
    -
    +

    As a fix, you might want to check and modify the algorithm to ensure it implements the expected logic.