diff --git a/python/pluginResources/inspectionDescriptions/BuildoutUnresolvedPartInspection.html b/python/pluginResources/inspectionDescriptions/BuildoutUnresolvedPartInspection.html index b5b36c654afe..3f9191b335ec 100644 --- a/python/pluginResources/inspectionDescriptions/BuildoutUnresolvedPartInspection.html +++ b/python/pluginResources/inspectionDescriptions/BuildoutUnresolvedPartInspection.html @@ -1,5 +1,5 @@ -This inspection highlights unresolved buildout parts. +

Reports unresolved references in the parts option of the Buildout configuration file.

diff --git a/python/pluginResources/inspectionDescriptions/CommandLineInspection.html b/python/pluginResources/inspectionDescriptions/CommandLineInspection.html index 6326441abde5..8cd516f15c3c 100644 --- a/python/pluginResources/inspectionDescriptions/CommandLineInspection.html +++ b/python/pluginResources/inspectionDescriptions/CommandLineInspection.html @@ -1,8 +1,8 @@ -Command line (commands, arguments and options) inspection. -

This inspection checks command you type in command console or command file. It helps you to make sure arguments are on their - places, option names are correct as well as arguments, provided for options.

-

Do not disable it if you are going to use command-line interfaces like manage.py in Django

+

Reports the problems if the arguments of the command you type in the console are not in the proper order. The inspection also verifies + that option names and arguments are correct.

+

Do not disable the inspection if you are going to use command-line interfaces like manage.py in Django.

\ No newline at end of file diff --git a/python/pluginResources/inspectionDescriptions/CythonUsageBeforeDeclarationInspection.html b/python/pluginResources/inspectionDescriptions/CythonUsageBeforeDeclarationInspection.html index 97e4a1e2af14..2a8c9d48a9c7 100644 --- a/python/pluginResources/inspectionDescriptions/CythonUsageBeforeDeclarationInspection.html +++ b/python/pluginResources/inspectionDescriptions/CythonUsageBeforeDeclarationInspection.html @@ -1,5 +1,13 @@ -This inspection warns about Cython variables being referenced before declaration. +

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/PyPep8Inspection.html b/python/pluginResources/inspectionDescriptions/PyPep8Inspection.html index 0769b2edda59..bde77e3ba62a 100644 --- a/python/pluginResources/inspectionDescriptions/PyPep8Inspection.html +++ b/python/pluginResources/inspectionDescriptions/PyPep8Inspection.html @@ -1,9 +1,6 @@ -This inspection runs the bundled pycodestyle.py tool -to check for violations of the PEP 8 coding style guide. -

- See PEP 8 for more details. -

+

Reports violations of the PEP 8 coding style guide by running the bundled pycodestyle.py tool.

\ No newline at end of file diff --git a/python/pluginResources/inspectionDescriptions/PyPep8NamingInspection.html b/python/pluginResources/inspectionDescriptions/PyPep8NamingInspection.html index 458e990bd806..8d9d0e52fed1 100644 --- a/python/pluginResources/inspectionDescriptions/PyPep8NamingInspection.html +++ b/python/pluginResources/inspectionDescriptions/PyPep8NamingInspection.html @@ -1,8 +1,23 @@ -This inspection checks the PEP8 naming conventions. -

- See PEP 8 for more details. -

+

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/PyRelativeImportInspection.html b/python/pluginResources/inspectionDescriptions/PyRelativeImportInspection.html index bcb0d791a590..1ccc4d0ebc6a 100644 --- a/python/pluginResources/inspectionDescriptions/PyRelativeImportInspection.html +++ b/python/pluginResources/inspectionDescriptions/PyRelativeImportInspection.html @@ -1,5 +1,7 @@ -This inspection reports usages of relative imports inside plain directories, i.e. directories neither containing __init__.py nor explicitly marked as namespace packages. +

Reports usages of relative imports inside plain directories, for example, directories neither containing __init__.py nor + explicitly marked as namespace packages. +

\ No newline at end of file diff --git a/python/pluginResources/inspectionDescriptions/PyShadowingBuiltinsInspection.html b/python/pluginResources/inspectionDescriptions/PyShadowingBuiltinsInspection.html index f25c27847c4f..d8136a8712d5 100644 --- a/python/pluginResources/inspectionDescriptions/PyShadowingBuiltinsInspection.html +++ b/python/pluginResources/inspectionDescriptions/PyShadowingBuiltinsInspection.html @@ -1,5 +1,13 @@ -This inspection detects shadowing built-in names, such as 'len' or 'list'. +

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.

\ No newline at end of file diff --git a/python/pluginResources/inspectionDescriptions/PyStubPackagesAdvertiser.html b/python/pluginResources/inspectionDescriptions/PyStubPackagesAdvertiser.html index 6646402f5906..e32e71c87382 100644 --- a/python/pluginResources/inspectionDescriptions/PyStubPackagesAdvertiser.html +++ b/python/pluginResources/inspectionDescriptions/PyStubPackagesAdvertiser.html @@ -1,8 +1,10 @@ -Advertises stub packages. +

Reports availability of stub packages.

-Stub package is a package that contains type information for the corresponding runtime package. -See PEP 561 for more details. + Stub package is a package that contains type information for the corresponding + runtime package. +

+

Using stub packages ensures better coding assistance for the corresponding python package.

\ No newline at end of file diff --git a/python/pluginResources/inspectionDescriptions/PyStubPackagesCompatibilityInspection.html b/python/pluginResources/inspectionDescriptions/PyStubPackagesCompatibilityInspection.html index 73cfe89ffc1c..ab4b0e371d2b 100644 --- a/python/pluginResources/inspectionDescriptions/PyStubPackagesCompatibilityInspection.html +++ b/python/pluginResources/inspectionDescriptions/PyStubPackagesCompatibilityInspection.html @@ -1,8 +1,6 @@ -Checks that a stub package supports the version of the corresponding runtime package. -

-Stub package is a package that contains type information for some runtime package. -See PEP 561 for more details. +

Reports stub packages that do not support the version of the corresponding runtime package.

+

A stub package contains type information for some runtime package.

\ No newline at end of file diff --git a/python/pluginResources/inspectionDescriptions/PyTestParametrizedInspection.html b/python/pluginResources/inspectionDescriptions/PyTestParametrizedInspection.html index 3ae2a0d86dfa..bd29d21e574e 100644 --- a/python/pluginResources/inspectionDescriptions/PyTestParametrizedInspection.html +++ b/python/pluginResources/inspectionDescriptions/PyTestParametrizedInspection.html @@ -1,5 +1,7 @@ -Test function, decorated with @pytest.mark.parametrize, must have arguments to accept parameters from decorator +

Reports functions that are decorated with + @pytest.mark.parametrize but do not have arguments to accept + parameters of the decorator.

diff --git a/python/pluginResources/inspectionDescriptions/PyUnresolvedReferencesInspection.html b/python/pluginResources/inspectionDescriptions/PyUnresolvedReferencesInspection.html index 7c82322bad23..8de03ef84269 100644 --- a/python/pluginResources/inspectionDescriptions/PyUnresolvedReferencesInspection.html +++ b/python/pluginResources/inspectionDescriptions/PyUnresolvedReferencesInspection.html @@ -1,7 +1,14 @@ -This inspection detects names that should resolve but don't. -Due to dynamic dispatch and duck typing, this is possible in a limited but useful -number of cases. Top-level and class-level items are supported better than instance items. +

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 a935c230aee5..2b653c21df3a 100644 --- a/python/pluginResources/inspectionDescriptions/RestRoleInspection.html +++ b/python/pluginResources/inspectionDescriptions/RestRoleInspection.html @@ -1,5 +1,17 @@ -This inspection detects undefined roles. +

Reports undefined roles in reStructuredText files.

+

Example:

+
+.. role:: custom
+.. role:: newcustom(emphasis)
+
+An example of using :custom:`interpreted text`
+An example of using :newcustom:`interpreted text`
+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/pluginResources/messages/PyBundle.properties b/python/pluginResources/messages/PyBundle.properties index e48c57bc5ece..55750c36a097 100644 --- a/python/pluginResources/messages/PyBundle.properties +++ b/python/pluginResources/messages/PyBundle.properties @@ -319,7 +319,7 @@ python.console.not.supported=Python console for {0} interpreter is not supported #Buildout buildout=Buildout -buildout.unresolved.part.inspection=Buildout config unresolved part inspection +buildout.unresolved.part.inspection=Unresolved parts of Buildout config buildout.unresolved.part.inspection.msg=Unresolved part reference buildout.configurable.enable.buildout.support.checkbox.text=&Enable buildout support runcfg.unittest.dlg.test_function_title=Function @@ -490,7 +490,7 @@ remote.interpreter.remote.server.permissions=Failed to browse the remote server. remote.interpreter.accessing.remote.interpreter.progress.title=Accessing Remote Interpreter # CommandLine -commandLine.inspection.name=Command-line inspection +commandLine.inspection.name=Incorrect CLI syntax commandLine.inspection.badCommand=Bad or unknown command. Ensure this command exists. commandLine.inspection.badOption=Bad or unknown option. Ensure this option exists. commandLine.inspection.badArgument=Argument cannot have this value. Use autocompletion to check the list of possible values. @@ -1121,8 +1121,8 @@ python.execution.is.still.running=Previous execution is still running INSP.settings.pep8.ignore.errors=Ignore Errors INSP.settings.pep8.ignore.errors.label=Ignored errors: -INSP.settings.bdd.behave.specific=BDD Behave-specific inspection -INSP.settings.bdd.step.definition.arguments=BDD step definition arguments inspection +INSP.settings.bdd.behave.specific=Incorrect BDD Behave-specific definitions +INSP.settings.bdd.step.definition.arguments=Incorrect arguments in step definition functions python.compatibility.inspection.advertiser.notifications.group.title=Python compatibility inspection advertiser python.compatibility.inspection.advertiser.notifications.title=Python versions compatibility diff --git a/python/python-psi-impl/resources/inspectionDescriptions/PyAbstractClassInspection.html b/python/python-psi-impl/resources/inspectionDescriptions/PyAbstractClassInspection.html index 7bbcd2ce30c0..104e897db86f 100644 --- a/python/python-psi-impl/resources/inspectionDescriptions/PyAbstractClassInspection.html +++ b/python/python-psi-impl/resources/inspectionDescriptions/PyAbstractClassInspection.html @@ -1,5 +1,41 @@ -This inspection detects when not all abstract properties/methods are defined in a subclass +

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

+

Example:

+
+from abc import abstractmethod, ABC
+
+
+class Figure(ABC):
+
+    @abstractmethod
+    def do_figure(self):
+        pass
+
+
+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
+
+
+class Figure(ABC):
+
+    @abstractmethod
+    def do_figure(self):
+        pass
+
+
+class Triangle(Figure):
+    def do_figure(self):
+        pass
+
+    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 6a2a9aa41b25..325a857ee085 100644 --- a/python/python-psi-impl/resources/inspectionDescriptions/PyArgumentEqualDefaultInspection.html +++ b/python/python-psi-impl/resources/inspectionDescriptions/PyArgumentEqualDefaultInspection.html @@ -1,5 +1,15 @@ -This inspection highlights situations, where argument passed to function is equal to default parameter value +

Reports a problem when an argument + 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 9eb983542833..ca34354b8538 100644 --- a/python/python-psi-impl/resources/inspectionDescriptions/PyArgumentListInspection.html +++ b/python/python-psi-impl/resources/inspectionDescriptions/PyArgumentListInspection.html @@ -1,6 +1,28 @@ -Reports discrepancies between declared parameters and actual arguments, as well as -incorrect arguments (e.g. duplicate named arguments) and incorrect argument order. Decorators are analyzed, too. +

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
+
+
+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
+
+
+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 b133795476fd..4a40b4bcf5a8 100644 --- a/python/python-psi-impl/resources/inspectionDescriptions/PyAssignmentToLoopOrWithParameterInspection.html +++ b/python/python-psi-impl/resources/inspectionDescriptions/PyAssignmentToLoopOrWithParameterInspection.html @@ -1,14 +1,14 @@ -Checks for cases when you rewrite loop variable with inner loop +Reports the cases when you rewrite a loop variable with an inner loop:
-    for i in xrange(5):
-      for i in xrange(20, 25):
+    for i in range(5):
+      for i in range(20, 25):
           print("Inner", i)
       print("Outer", i)
   
-It also warns you if variable declared in with statement is redeclared inside of statement body: +It also warns you if a variable declared in the with statement is redeclared inside of the statement body:
     with open("file") as f:
       f.read()
diff --git a/python/python-psi-impl/resources/inspectionDescriptions/PyAsyncCallInspection.html b/python/python-psi-impl/resources/inspectionDescriptions/PyAsyncCallInspection.html
index 9bc2d4281a40..8139648180a0 100644
--- a/python/python-psi-impl/resources/inspectionDescriptions/PyAsyncCallInspection.html
+++ b/python/python-psi-impl/resources/inspectionDescriptions/PyAsyncCallInspection.html
@@ -1,5 +1,24 @@
 
 
-This inspection highlights coroutines which were called without await
+

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 045c8dfc6a8f..53914a2dc44b 100644 --- a/python/python-psi-impl/resources/inspectionDescriptions/PyAttributeOutsideInitInspection.html +++ b/python/python-psi-impl/resources/inspectionDescriptions/PyAttributeOutsideInitInspection.html @@ -1,5 +1,27 @@ -This inspection detects instance attribute definition outside __init__ method +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'
+        self.author = 'Mark Twain'
+
+    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 97a41c920469..e13c6a3092b9 100644 --- a/python/python-psi-impl/resources/inspectionDescriptions/PyAugmentAssignmentInspection.html +++ b/python/python-psi-impl/resources/inspectionDescriptions/PyAugmentAssignmentInspection.html @@ -1,5 +1,17 @@ -This inspection highlights assignment that can be replaced with augmented assignment. +

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/PyBroadExceptionInspection.html b/python/python-psi-impl/resources/inspectionDescriptions/PyBroadExceptionInspection.html index 7cdb2480a48d..af50dc054733 100644 --- a/python/python-psi-impl/resources/inspectionDescriptions/PyBroadExceptionInspection.html +++ b/python/python-psi-impl/resources/inspectionDescriptions/PyBroadExceptionInspection.html @@ -1,6 +1,11 @@ -This inspection highlights too broad exception clauses such as -no exception class specified, or specified as 'Exception'. +

Reports exception clauses that do not provide specific information + about the problem.

+

Example:

+ \ 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 cc910219f11a..d8415bce713d 100644 --- a/python/python-psi-impl/resources/inspectionDescriptions/PyByteLiteralInspection.html +++ b/python/python-psi-impl/resources/inspectionDescriptions/PyByteLiteralInspection.html @@ -1,5 +1,7 @@ -This inspection detects characters > 255 in byte literals. +

Reports characters in byte literals that are outside ASCII range.

+

Example:

+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 03d4e6f5c642..8e72ddadf312 100644 --- a/python/python-psi-impl/resources/inspectionDescriptions/PyCallingNonCallableInspection.html +++ b/python/python-psi-impl/resources/inspectionDescriptions/PyCallingNonCallableInspection.html @@ -1,5 +1,13 @@ -This inspection highlights attempts to call objects which are not callable, like, for example, tuples. +

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

+
+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/PyChainedComparisonsInspection.html b/python/python-psi-impl/resources/inspectionDescriptions/PyChainedComparisonsInspection.html index efbea07c960f..94a452cd8cc7 100644 --- a/python/python-psi-impl/resources/inspectionDescriptions/PyChainedComparisonsInspection.html +++ b/python/python-psi-impl/resources/inspectionDescriptions/PyChainedComparisonsInspection.html @@ -1,5 +1,22 @@ -This inspection highlights chained comparisons that can be simplified. +

Reports chained comparisons that can be simplified.

+

Example:

+
+def do_comparison(x):
+    xmin = 10
+    xmax = 100
+    if x >= xmin and x <= xmax:
+        pass
+
+

The IDE offers to simplify if x >= xmin and x <= xmax. + When the quick-fix is applied, the code changes to:

+
+def do_comparison(x):
+    xmin = 10
+    xmax = 100
+    if xmin <= x <= xmax:
+        pass
+
\ 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 6db16549795c..66bc769c1c36 100644 --- a/python/python-psi-impl/resources/inspectionDescriptions/PyClassHasNoInitInspection.html +++ b/python/python-psi-impl/resources/inspectionDescriptions/PyClassHasNoInitInspection.html @@ -1,5 +1,17 @@ -This inspection used when a class has no __init__ method, neither its parent classes. +

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/PyClassicStyleClassInspection.html b/python/python-psi-impl/resources/inspectionDescriptions/PyClassicStyleClassInspection.html index 54199a8a6985..1271936c6ded 100644 --- a/python/python-psi-impl/resources/inspectionDescriptions/PyClassicStyleClassInspection.html +++ b/python/python-psi-impl/resources/inspectionDescriptions/PyClassicStyleClassInspection.html @@ -1,5 +1,17 @@ -This inspection detects classic style classes usage. +

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 05e4c5053316..1e763a84f007 100644 --- a/python/python-psi-impl/resources/inspectionDescriptions/PyComparisonWithNoneInspection.html +++ b/python/python-psi-impl/resources/inspectionDescriptions/PyComparisonWithNoneInspection.html @@ -1,6 +1,23 @@ -This inspection highlights comparisons with None. That type of comparisons -should always be done with 'is' or 'is not', never the equality operators. +

Reports comparisons with None. That type of comparisons + 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/PyCompatibilityInspection.html b/python/python-psi-impl/resources/inspectionDescriptions/PyCompatibilityInspection.html index d3574642b9b2..1ffd3c5b7695 100644 --- a/python/python-psi-impl/resources/inspectionDescriptions/PyCompatibilityInspection.html +++ b/python/python-psi-impl/resources/inspectionDescriptions/PyCompatibilityInspection.html @@ -1,7 +1,11 @@ -Enable this inspection if you need your code to be compatible with a range of Python versions (for example, if you're building a -library). -The range of Python versions with which the code needs to be compatible can be specified in the inspection settings. +

Reports incompatibility with the specified versions of Python. + Enable this inspection if you need your code to be compatible with a range of Python versions, for example, + if you are building a library.

+

To define the range of the inspected Python versions, select the corresponding checkboxes in the Options + section.

+

For more information about the Python versions supported by the IDE, see the + web help.

\ 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 71740fa8341c..f711b5313bbf 100644 --- a/python/python-psi-impl/resources/inspectionDescriptions/PyDataclassInspection.html +++ b/python/python-psi-impl/resources/inspectionDescriptions/PyDataclassInspection.html @@ -1,5 +1,17 @@ -This inspection detects invalid definitions and usages of classes created with `dataclasses` or `attr` modules. +

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

+

Example:

+
+import dataclasses
+
+
+@dataclasses.dataclass
+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 ef9e66e0572f..d6c9bc048845 100644 --- a/python/python-psi-impl/resources/inspectionDescriptions/PyDecoratorInspection.html +++ b/python/python-psi-impl/resources/inspectionDescriptions/PyDecoratorInspection.html @@ -1,5 +1,33 @@ -Reports usages of @classmethod or @staticmethod decorators on functions outside of a class. +

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

+

Example:

+
+class State(object):
+
+    @classmethod
+    def my_state(cls, name):
+        cls.name = name
+
+
+@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
+    def my_state(cls, name):
+        cls.name = name
+
+
+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 bc01b101eb61..fb76fc991c84 100644 --- a/python/python-psi-impl/resources/inspectionDescriptions/PyDefaultArgumentInspection.html +++ b/python/python-psi-impl/resources/inspectionDescriptions/PyDefaultArgumentInspection.html @@ -1,7 +1,21 @@ -This inspection detects when a mutable value as list or dictionary is detected in a default value for an argument.
-Default argument values are evaluated only once at function definition time, which means that modifying the -default value of the argument will affect all subsequent calls of the function. +

Reports a problem when a mutable value as a list or dictionary is detected in a default value for + an argument.
+ Default argument values are evaluated only once at function definition time, + 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 0eba1c6040c6..ac79fe9666db 100644 --- a/python/python-psi-impl/resources/inspectionDescriptions/PyDeprecationInspection.html +++ b/python/python-psi-impl/resources/inspectionDescriptions/PyDeprecationInspection.html @@ -1,6 +1,21 @@ -This inspection highlights usages of Python functions, classes or methods which are marked as deprecated (which raise a -DeprecationWarning or a PendingDeprecationWarning). +

Reports usages of Python functions, or methods that are marked as + deprecated and raise the DeprecationWarning or PendingDeprecationWarning warning.

+

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

+

Example:

+
+class Foo:
+    @property
+    def bar(self):
+        import warnings
+        warnings.warn("this is deprecated", DeprecationWarning, 2)
+        return 5
+
+
+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 0f08803c4b2b..7c2b12555b9a 100644 --- a/python/python-psi-impl/resources/inspectionDescriptions/PyDictCreationInspection.html +++ b/python/python-psi-impl/resources/inspectionDescriptions/PyDictCreationInspection.html @@ -1,6 +1,16 @@ -This inspection detects situations when dictionary creation -could be rewritten with dictionary literal. +

Reports situations when you can rewrite dictionary creation + 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 53f71d2c9d9e..9c8f20ad3346 100644 --- a/python/python-psi-impl/resources/inspectionDescriptions/PyDictDuplicateKeysInspection.html +++ b/python/python-psi-impl/resources/inspectionDescriptions/PyDictDuplicateKeysInspection.html @@ -1,5 +1,9 @@ -This inspection highlights using the same value as dictionary key twice. +

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/PyDocstringTypesInspection.html b/python/python-psi-impl/resources/inspectionDescriptions/PyDocstringTypesInspection.html index 18f462f3a161..732b301a74a0 100644 --- a/python/python-psi-impl/resources/inspectionDescriptions/PyDocstringTypesInspection.html +++ b/python/python-psi-impl/resources/inspectionDescriptions/PyDocstringTypesInspection.html @@ -1,5 +1,5 @@ -This inspection highlights types in docstring which don't match dynamically inferred types. +

Reports types in docstring that do not match dynamically inferred types.

\ 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 e742af8b3367..71873424d4bd 100644 --- a/python/python-psi-impl/resources/inspectionDescriptions/PyDunderSlotsInspection.html +++ b/python/python-psi-impl/resources/inspectionDescriptions/PyDunderSlotsInspection.html @@ -1,5 +1,14 @@ -This inspection detects invalid definition of __slots__ in a class. +

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 7a496492e111..20abca4c9265 100644 --- a/python/python-psi-impl/resources/inspectionDescriptions/PyExceptClausesOrderInspection.html +++ b/python/python-psi-impl/resources/inspectionDescriptions/PyExceptClausesOrderInspection.html @@ -1,7 +1,27 @@ -This inspection highlights situations when except clauses are not in the correct order -(from the more specific to the more generic) or one exception class is caught twice.
-If you don't fix the order, some exceptions may not be catched by the most specific handler. +

Reports cases when except clauses are not in the proper order, + from the more specific to the more generic, or one exception class is caught twice.

+

+ 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 6f310d366726..37a994a1275b 100644 --- a/python/python-psi-impl/resources/inspectionDescriptions/PyExceptionInheritInspection.html +++ b/python/python-psi-impl/resources/inspectionDescriptions/PyExceptionInheritInspection.html @@ -1,5 +1,25 @@ -This inspection detects when a custom exception class is raised but doesn't inherit from the builtin "Exception" class. +

Reports cases when a custom exception class is + 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 6c7fcc28b4e6..2dbcd4afd183 100644 --- a/python/python-psi-impl/resources/inspectionDescriptions/PyFinalInspection.html +++ b/python/python-psi-impl/resources/inspectionDescriptions/PyFinalInspection.html @@ -1,5 +1,21 @@ -This inspection detects invalid usages of final classes, methods and variables. +

Reports invalid usages of final classes, + methods and variables.

+

Example:

+
+from typing import final
+
+
+@final
+class A:
+    def a_method(self):
+        pass
+
+
+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 a0a1754db031..d92ff307b12d 100644 --- a/python/python-psi-impl/resources/inspectionDescriptions/PyFromFutureImportInspection.html +++ b/python/python-psi-impl/resources/inspectionDescriptions/PyFromFutureImportInspection.html @@ -1,5 +1,20 @@ -This inspection detects 'from __future__ import' statements which are used not in the beginning of a file. +

Reports from __future__ import + 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 91ffbd2b7728..2a22c2828a3e 100644 --- a/python/python-psi-impl/resources/inspectionDescriptions/PyGlobalUndefinedInspection.html +++ b/python/python-psi-impl/resources/inspectionDescriptions/PyGlobalUndefinedInspection.html @@ -1,6 +1,22 @@ -This inspection is used when a variable is defined through the "global" statement but the variable is not defined in the module -scope. +

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/PyInconsistentIndentationInspection.html b/python/python-psi-impl/resources/inspectionDescriptions/PyInconsistentIndentationInspection.html index aad1e9a19e1e..a874f3433c66 100644 --- a/python/python-psi-impl/resources/inspectionDescriptions/PyInconsistentIndentationInspection.html +++ b/python/python-psi-impl/resources/inspectionDescriptions/PyInconsistentIndentationInspection.html @@ -1,6 +1,6 @@ -Reports inconsistent indentation in Python source files (for example, use of a mixture -of tabs and spaces). +

Reports inconsistent indentation in Python source files when, for example, + you use a mixture of tabs and spaces in your code.

diff --git a/python/python-psi-impl/resources/inspectionDescriptions/PyIncorrectDocstringInspection.html b/python/python-psi-impl/resources/inspectionDescriptions/PyIncorrectDocstringInspection.html index dc1aa630a165..3838061645f7 100644 --- a/python/python-psi-impl/resources/inspectionDescriptions/PyIncorrectDocstringInspection.html +++ b/python/python-psi-impl/resources/inspectionDescriptions/PyIncorrectDocstringInspection.html @@ -1,6 +1,23 @@ -This inspection detects mismatched parameters in a docstring. -Please note that it doesn't warn you of missing parameters, if none of them is mentioned in a docstring. +

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:
+    @param b:
+    @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 2a3c5ed830d2..633aa4440432 100644 --- a/python/python-psi-impl/resources/inspectionDescriptions/PyInitNewSignatureInspection.html +++ b/python/python-psi-impl/resources/inspectionDescriptions/PyInitNewSignatureInspection.html @@ -1,5 +1,17 @@ -This inspection checks mutual compatibility of __new__ and __init__ signatures. +

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/PyInterpreterInspection.html b/python/python-psi-impl/resources/inspectionDescriptions/PyInterpreterInspection.html index 22326fa5bb19..5904811c3c9f 100644 --- a/python/python-psi-impl/resources/inspectionDescriptions/PyInterpreterInspection.html +++ b/python/python-psi-impl/resources/inspectionDescriptions/PyInterpreterInspection.html @@ -1,5 +1,7 @@ -This inspection notifies you if the current project has no Python interpreter configured or an invalid Python interpreter. +

Reports problems if there is no Python interpreter configured for the project or if the interpreter is invalid. Without a properly + configured interpreter, you cannot execute your Python scripts and benefit from some Python code insight features.

+

The IDE provides quick access to the interpreter settings.

diff --git a/python/python-psi-impl/resources/inspectionDescriptions/PyListCreationInspection.html b/python/python-psi-impl/resources/inspectionDescriptions/PyListCreationInspection.html index 70f3208bc695..611d10d319ac 100644 --- a/python/python-psi-impl/resources/inspectionDescriptions/PyListCreationInspection.html +++ b/python/python-psi-impl/resources/inspectionDescriptions/PyListCreationInspection.html @@ -1,6 +1,16 @@ -This inspection detects situations when list creation -could be rewritten with list literal. +

Reports cases when a list declaration + 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 92d69421327e..539a0073cfab 100644 --- a/python/python-psi-impl/resources/inspectionDescriptions/PyMandatoryEncodingInspection.html +++ b/python/python-psi-impl/resources/inspectionDescriptions/PyMandatoryEncodingInspection.html @@ -1,5 +1,18 @@ -This inspection detects lack of encoding magic comment for file. +

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 4bf0a9d37e5c..78ddaf7ba923 100644 --- a/python/python-psi-impl/resources/inspectionDescriptions/PyMethodFirstArgAssignmentInspection.html +++ b/python/python-psi-impl/resources/inspectionDescriptions/PyMethodFirstArgAssignmentInspection.html @@ -1,5 +1,17 @@ -This inspection detects cases when first parameter, such as 'self' or 'cls', is reassigned in a method. -In most cases imaginable, there's no point in such reassignment, and it indicates an error. +

Reports cases when the first parameter, + such as self or cls, is reassigned in a method. + 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 416b9df45c34..e6b47bca084f 100644 --- a/python/python-psi-impl/resources/inspectionDescriptions/PyMethodMayBeStaticInspection.html +++ b/python/python-psi-impl/resources/inspectionDescriptions/PyMethodMayBeStaticInspection.html @@ -1,5 +1,28 @@ -This inspection detects any methods which may safely be made static. +

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 03bf5b16e75b..47c072bbaac1 100644 --- a/python/python-psi-impl/resources/inspectionDescriptions/PyMethodOverridingInspection.html +++ b/python/python-psi-impl/resources/inspectionDescriptions/PyMethodOverridingInspection.html @@ -1,5 +1,21 @@ -This inspection detects inconsistencies in overriding method signatures. +

Reports inconsistencies in overriding method signatures.

+ +

Example:

+
+class Book:
+    def add_title(self):
+        pass
+
+
+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 + refactoring.

\ No newline at end of file diff --git a/python/python-psi-impl/resources/inspectionDescriptions/PyMethodParametersInspection.html b/python/python-psi-impl/resources/inspectionDescriptions/PyMethodParametersInspection.html index 30002d9e8579..61df51dc92e4 100644 --- a/python/python-psi-impl/resources/inspectionDescriptions/PyMethodParametersInspection.html +++ b/python/python-psi-impl/resources/inspectionDescriptions/PyMethodParametersInspection.html @@ -1,5 +1,30 @@ -This inspection looks for methods that lack a first parameter (which is usually named self ). +

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 a51268996bf9..d40d5d3be9cc 100644 --- a/python/python-psi-impl/resources/inspectionDescriptions/PyMissingConstructorInspection.html +++ b/python/python-psi-impl/resources/inspectionDescriptions/PyMissingConstructorInspection.html @@ -1,5 +1,29 @@ -This inspection warns if call to super constructor in class is missed +

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

+

Example:

+
+class Fruit:
+    def __init__(self):
+        pass
+
+
+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
+
+
+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 2d9a3c4eb069..6761a9053e87 100644 --- a/python/python-psi-impl/resources/inspectionDescriptions/PyMissingOrEmptyDocstringInspection.html +++ b/python/python-psi-impl/resources/inspectionDescriptions/PyMissingOrEmptyDocstringInspection.html @@ -1,5 +1,27 @@ -This inspection detects lack of docstring and an empty docstring. +

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/PyMissingTypeHintsInspection.html b/python/python-psi-impl/resources/inspectionDescriptions/PyMissingTypeHintsInspection.html index 4b947b0a6475..a40eaf099855 100644 --- a/python/python-psi-impl/resources/inspectionDescriptions/PyMissingTypeHintsInspection.html +++ b/python/python-psi-impl/resources/inspectionDescriptions/PyMissingTypeHintsInspection.html @@ -1,6 +1,8 @@ -This inspection detects lack of type hints for function declaration in -one of the two formats: parameter annotations or a type comment +

Reports missing type hints for function declaration in + one of the two formats: parameter annotations or a type comment.

+

Select the Only when types are known checkbox if you want the inspection check + the types collected from runtime or inferred.

\ 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 8d56a314df81..b9d20cea54f6 100644 --- a/python/python-psi-impl/resources/inspectionDescriptions/PyNamedTupleInspection.html +++ b/python/python-psi-impl/resources/inspectionDescriptions/PyNamedTupleInspection.html @@ -1,5 +1,26 @@ -This inspection detects invalid definition of namedtuple. +

Reports invalid definition of a + typing.NamedTuple.

+

Example:

+
+import typing
+
+
+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
+
+
+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 ef18e45ed96a..eafe712e20e2 100644 --- a/python/python-psi-impl/resources/inspectionDescriptions/PyNestedDecoratorsInspection.html +++ b/python/python-psi-impl/resources/inspectionDescriptions/PyNestedDecoratorsInspection.html @@ -1,5 +1,24 @@ -This inspection looks for certain decorators that don't nest well. +

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
+
+
+class A:
+    @innocent  # Decorator will not receive a callable it may expect
+    @classmethod
+    def f2(cls):
+        pass
+
+    @innocent  # Decorator will not receive a callable it may expect
+    @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 f0420c14f4a3..72afad76733f 100644 --- a/python/python-psi-impl/resources/inspectionDescriptions/PyNonAsciiCharInspection.html +++ b/python/python-psi-impl/resources/inspectionDescriptions/PyNonAsciiCharInspection.html @@ -1,5 +1,22 @@ -This inspection detects file contains non-ASCII characters and doesn't have an encoding declaration at the top. +

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 5ad7a78fb3ca..2e8810a9ce18 100644 --- a/python/python-psi-impl/resources/inspectionDescriptions/PyNoneFunctionAssignmentInspection.html +++ b/python/python-psi-impl/resources/inspectionDescriptions/PyNoneFunctionAssignmentInspection.html @@ -1,6 +1,16 @@ -This inspection is similar to pylint inspection E1111. It highlights situations when an assignment is done on a function call but the -inferred function doesn't return anything. +

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/PyOldStyleClassesInspection.html b/python/python-psi-impl/resources/inspectionDescriptions/PyOldStyleClassesInspection.html index 51204c0e2b50..74a91a5c0bed 100644 --- a/python/python-psi-impl/resources/inspectionDescriptions/PyOldStyleClassesInspection.html +++ b/python/python-psi-impl/resources/inspectionDescriptions/PyOldStyleClassesInspection.html @@ -1,5 +1,9 @@ -This inspection highlights occurrences of new-style class features in old-style classes. +

Reports occurrences of + new-style class features + in old-style classes. The inspection highlights + __slots__, __getattribute__, and super() + inside old-style classes.

\ 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 2fe9259e716e..8f472e2d9c50 100644 --- a/python/python-psi-impl/resources/inspectionDescriptions/PyOverloadsInspection.html +++ b/python/python-psi-impl/resources/inspectionDescriptions/PyOverloadsInspection.html @@ -1,5 +1,24 @@ -This inspection validates overloads in regular Python files. +

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
+
+
+@overload
+def foo(p1, p2): # Overload signature is not compatible with the implementation
+    pass
+
+
+@overload
+def foo(p1): # Overload signature is not compatible with the implementation
+    pass
+
+
+def foo(p1, p2, p3):
+    print(p1, p2, p3)
+
\ No newline at end of file diff --git a/python/python-psi-impl/resources/inspectionDescriptions/PyPackageRequirementsInspection.html b/python/python-psi-impl/resources/inspectionDescriptions/PyPackageRequirementsInspection.html index a1aabba5bcd3..e878df96e22e 100644 --- a/python/python-psi-impl/resources/inspectionDescriptions/PyPackageRequirementsInspection.html +++ b/python/python-psi-impl/resources/inspectionDescriptions/PyPackageRequirementsInspection.html @@ -1,5 +1,10 @@ -This inspection warns about imported or required, but not installed packages. +

+ Reports packages mentioned in requirements files (for example, requirements.txt or Pipfile) but not installed, + or imported but not mentioned in requirements files.

+

+ The IDE shows a quick-fix banner so that you can install the missing packages in one click. +

\ 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 fe41c3015c07..0b4855b27725 100644 --- a/python/python-psi-impl/resources/inspectionDescriptions/PyPropertyAccessInspection.html +++ b/python/python-psi-impl/resources/inspectionDescriptions/PyPropertyAccessInspection.html @@ -1,6 +1,26 @@ -This inspection checks that properties are accessed correctly: -read-only not set, write-only not read, non-deletable not deleted. +Reports cases when properties are accessed inappropriately: + +

Example:

+
+class MyClass:
+    @property
+    def read_only(self): return None
+
+    def __write_only_setter(self, value): pass
+
+    write_only = property(None, __write_only_setter)
+
+
+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 97fba437b9fc..47bea9cb35e8 100644 --- a/python/python-psi-impl/resources/inspectionDescriptions/PyPropertyDefinitionInspection.html +++ b/python/python-psi-impl/resources/inspectionDescriptions/PyPropertyDefinitionInspection.html @@ -1,6 +1,25 @@ -This inspection checks that arguments to property() and functions annotated with -@property and friends look reasonably. +

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

+
+class C:
+    @property
+    def abc(self):  # Getter should return or yield something
+        pass
+
+    @abc.setter
+    def foo(self, value):  # Names of function and decorator don't match
+        pass
+
+    @abc.setter
+    def abc(self, v1, v2):  # Setter signature should be (self, value)
+        pass
+
+    @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 fd2dd25071e5..75908a07f08b 100644 --- a/python/python-psi-impl/resources/inspectionDescriptions/PyProtectedMemberInspection.html +++ b/python/python-psi-impl/resources/inspectionDescriptions/PyProtectedMemberInspection.html @@ -1,5 +1,20 @@ -This inspection warns if a protected member is accessed outside the class, a descendant of the class where it's defined or a module. +

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

+
+class Foo:
+    def _protected_method(self):
+        pass
+
+
+class Bar(Foo):
+    def public_method(self):
+        self._protected_method()
+
+
+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 2200d3d9ccb3..32b7a063e608 100644 --- a/python/python-psi-impl/resources/inspectionDescriptions/PyProtocolInspection.html +++ b/python/python-psi-impl/resources/inspectionDescriptions/PyProtocolInspection.html @@ -1,5 +1,25 @@ -This inspection detects invalid definitions and usages of protocols introduced in PEP-544. +

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

+

Example:

+
+from typing import Protocol
+
+
+class MyProtocol(Protocol):
+    def method(self, p: int) -> str:
+        pass
+
+
+class MyClass(MyProtocol):
+    def method(self, p: str) -> int: # Type of 'method' is not compatible with 'MyProtocol'
+        pass
+
+
+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 c404c70ce1d4..28577a52939e 100644 --- a/python/python-psi-impl/resources/inspectionDescriptions/PyRedeclarationInspection.html +++ b/python/python-psi-impl/resources/inspectionDescriptions/PyRedeclarationInspection.html @@ -1,9 +1,15 @@ -This inspection detects unconditional redeclarations of names without being used in between, like this:
-
def x(): pass
+

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.
+

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/PyRedundantParenthesesInspection.html b/python/python-psi-impl/resources/inspectionDescriptions/PyRedundantParenthesesInspection.html index b6f08939b7b2..8fa8226f14a0 100644 --- a/python/python-psi-impl/resources/inspectionDescriptions/PyRedundantParenthesesInspection.html +++ b/python/python-psi-impl/resources/inspectionDescriptions/PyRedundantParenthesesInspection.html @@ -1,5 +1,6 @@ -This inspection highlights redundant parentheses in statements. +

Reports about redundant parentheses in expressions.

+

The IDE provides the quick-fix action to remove the redundant parentheses.

\ No newline at end of file diff --git a/python/python-psi-impl/resources/inspectionDescriptions/PyReturnFromInitInspection.html b/python/python-psi-impl/resources/inspectionDescriptions/PyReturnFromInitInspection.html index ff2595a9d253..f8919f539e05 100644 --- a/python/python-psi-impl/resources/inspectionDescriptions/PyReturnFromInitInspection.html +++ b/python/python-psi-impl/resources/inspectionDescriptions/PyReturnFromInitInspection.html @@ -1,6 +1,20 @@ -Reports occurrences of return statements with a return value inside -__init__ methods of classes. A constructor should not return any value. +

+ Reports occurrences of return statements with a return value inside + __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 643b13dce56f..918392a39c05 100644 --- a/python/python-psi-impl/resources/inspectionDescriptions/PySetFunctionToLiteralInspection.html +++ b/python/python-psi-impl/resources/inspectionDescriptions/PySetFunctionToLiteralInspection.html @@ -1,6 +1,18 @@ -This inspection detects call for function "set" which can be replaced with -set literal. +

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 dabfaf0b94a1..e3517a64a3bc 100644 --- a/python/python-psi-impl/resources/inspectionDescriptions/PyShadowingNamesInspection.html +++ b/python/python-psi-impl/resources/inspectionDescriptions/PyShadowingNamesInspection.html @@ -1,5 +1,12 @@ -This inspection detects shadowing names defined in outer scopes. +

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 7543541f5896..9ebaa14f21a3 100644 --- a/python/python-psi-impl/resources/inspectionDescriptions/PySimplifyBooleanCheckInspection.html +++ b/python/python-psi-impl/resources/inspectionDescriptions/PySimplifyBooleanCheckInspection.html @@ -1,5 +1,17 @@ -This inspection detects equality comparison with a boolean literal. +

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 daf9d3860fa2..c33db5b5153d 100644 --- a/python/python-psi-impl/resources/inspectionDescriptions/PySingleQuotedDocstringInspection.html +++ b/python/python-psi-impl/resources/inspectionDescriptions/PySingleQuotedDocstringInspection.html @@ -1,5 +1,17 @@ -This inspection highlights docstrings not using triple double-quoted string format. +

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 75b5569f1bd7..4b183ca123ce 100644 --- a/python/python-psi-impl/resources/inspectionDescriptions/PyStatementEffectInspection.html +++ b/python/python-psi-impl/resources/inspectionDescriptions/PyStatementEffectInspection.html @@ -1,5 +1,16 @@ -This inspection detects statements without any effect. +

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.

\ No newline at end of file diff --git a/python/python-psi-impl/resources/inspectionDescriptions/PyStringFormatInspection.html b/python/python-psi-impl/resources/inspectionDescriptions/PyStringFormatInspection.html index c9b9c12aeaef..b0456f8c4edd 100644 --- a/python/python-psi-impl/resources/inspectionDescriptions/PyStringFormatInspection.html +++ b/python/python-psi-impl/resources/inspectionDescriptions/PyStringFormatInspection.html @@ -1,5 +1,19 @@ -This inspection detects errors in string formatting operations. +

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.

\ No newline at end of file diff --git a/python/python-psi-impl/resources/inspectionDescriptions/PySuperArgumentsInspection.html b/python/python-psi-impl/resources/inspectionDescriptions/PySuperArgumentsInspection.html index 6c7b047af71d..af5db2fbd46d 100644 --- a/python/python-psi-impl/resources/inspectionDescriptions/PySuperArgumentsInspection.html +++ b/python/python-psi-impl/resources/inspectionDescriptions/PySuperArgumentsInspection.html @@ -1,5 +1,27 @@ -This inspection check that in any call to super(A, B), B either is an instance of A or a subclass of A. +

Reports cases when any call to super(A, B) does not meet the + following requirements:

+ +

Example:

+
+class Figure:
+    def color(self):
+        pass
+
+
+class Rectangle(Figure):
+    def color(self):
+        pass
+
+
+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 fb117b746c86..185e0b16a46b 100644 --- a/python/python-psi-impl/resources/inspectionDescriptions/PyTrailingSemicolonInspection.html +++ b/python/python-psi-impl/resources/inspectionDescriptions/PyTrailingSemicolonInspection.html @@ -1,5 +1,18 @@ -This inspection detects trailing semicolons in statements. +

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 9d62c47e0a91..e9529749de37 100644 --- a/python/python-psi-impl/resources/inspectionDescriptions/PyTupleAssignmentBalanceInspection.html +++ b/python/python-psi-impl/resources/inspectionDescriptions/PyTupleAssignmentBalanceInspection.html @@ -1,5 +1,13 @@ -This inspection check that the number of expressions on right-hand side and targets on left-hand side are the same. +

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.

\ No newline at end of file diff --git a/python/python-psi-impl/resources/inspectionDescriptions/PyTupleItemAssignmentInspection.html b/python/python-psi-impl/resources/inspectionDescriptions/PyTupleItemAssignmentInspection.html index 2e216bc19aa7..69522c28f51f 100644 --- a/python/python-psi-impl/resources/inspectionDescriptions/PyTupleItemAssignmentInspection.html +++ b/python/python-psi-impl/resources/inspectionDescriptions/PyTupleItemAssignmentInspection.html @@ -1,5 +1,10 @@ -This inspection detects assignments to tuple item. +

Reports assignments to a tuple item.

+
+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 abef2fd69fbc..9929ebd029f4 100644 --- a/python/python-psi-impl/resources/inspectionDescriptions/PyTypeCheckerInspection.html +++ b/python/python-psi-impl/resources/inspectionDescriptions/PyTypeCheckerInspection.html @@ -1,8 +1,25 @@ -This inspection detects type errors in function call expressions. -Due to dynamic dispatch and duck typing, this is possible in a limited but -useful number of cases. Types of function parameters can be specified in -docstrings or in Python 3 function annotations. +

Reports type errors in function call expressions, targets, and return values. In a dynamically typed language, this is possible in a limited number of cases.

+

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 d5f597548c75..ccad59dcb748 100644 --- a/python/python-psi-impl/resources/inspectionDescriptions/PyTypeHintsInspection.html +++ b/python/python-psi-impl/resources/inspectionDescriptions/PyTypeHintsInspection.html @@ -1,5 +1,22 @@ -This inspection detects invalid usages of type hints. +

Reports invalid usages of type hints.

+

Example:

+
+from typing import TypeVar
+
+T0 = TypeVar('T1') # Argument of 'TypeVar' must be 'T0'
+
+
+def b(p: int) -> int:  # Type specified both in a comment and annotation
+    # type: (int) -> int
+    pass
+
+
+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 665f49a5f956..dc1186d5bc9d 100644 --- a/python/python-psi-impl/resources/inspectionDescriptions/PyTypedDictInspection.html +++ b/python/python-psi-impl/resources/inspectionDescriptions/PyTypedDictInspection.html @@ -1,5 +1,25 @@ -This inspection detects invalid definition and usage of TypedDict. +

Reports invalid definition and usage of + TypedDict.

+

Example:

+
+from typing import TypedDict
+
+
+class Movie(TypedDict):
+    name: str
+    year: int
+    rate: int = 10  # Right-hand side values are not supported
+
+    def method(self): # Invalid statement in TypedDict
+        pass
+
+
+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 39df5cb62f67..08b769d90c55 100644 --- a/python/python-psi-impl/resources/inspectionDescriptions/PyUnboundLocalVariableInspection.html +++ b/python/python-psi-impl/resources/inspectionDescriptions/PyUnboundLocalVariableInspection.html @@ -1,5 +1,19 @@ -This inspection warns about local variables referenced before assignment. +

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 4cb49cd72001..b26a4fabd4d7 100644 --- a/python/python-psi-impl/resources/inspectionDescriptions/PyUnnecessaryBackslashInspection.html +++ b/python/python-psi-impl/resources/inspectionDescriptions/PyUnnecessaryBackslashInspection.html @@ -1,5 +1,12 @@ -This inspection highlights backslashes in places where line continuation is implicit (inside (), [], {}). +

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 b94d483c30b2..6226c2000048 100644 --- a/python/python-psi-impl/resources/inspectionDescriptions/PyUnreachableCodeInspection.html +++ b/python/python-psi-impl/resources/inspectionDescriptions/PyUnreachableCodeInspection.html @@ -1,4 +1,13 @@ -This inspection detects code which can not be normally reached. +

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.

diff --git a/python/python-psi-impl/resources/inspectionDescriptions/PyUnusedLocalInspection.html b/python/python-psi-impl/resources/inspectionDescriptions/PyUnusedLocalInspection.html index 48b83afb4f5c..a8cf9eeedfb1 100644 --- a/python/python-psi-impl/resources/inspectionDescriptions/PyUnusedLocalInspection.html +++ b/python/python-psi-impl/resources/inspectionDescriptions/PyUnusedLocalInspection.html @@ -1,4 +1,6 @@ -This inspection highlights local variables,parameters or local functions unused in scope. +

+ Reports local variables, parameters, and functions that are locally defined, but not used name in a function. +

diff --git a/python/python-psi-impl/resources/messages/PyPsiBundle.properties b/python/python-psi-impl/resources/messages/PyPsiBundle.properties index 21eb7a600742..82be6157ed06 100644 --- a/python/python-psi-impl/resources/messages/PyPsiBundle.properties +++ b/python/python-psi-impl/resources/messages/PyPsiBundle.properties @@ -458,7 +458,7 @@ INSP.GROUP.python=Python INSP.abstract.class.set.as.metaclass=Set ''{0}'' as metaclass INSP.abstract.class.add.to.superclasses=Add ''{0}'' to superclasses -INSP.named.tuple=Namedtuple definition +INSP.named.tuple=Invalid definition of 'typing.NamedTuple' INSP.shadows.name.from.outer.scope=Shadows name ''{0}'' from outer scope INSP.trailing.semicolon=Trailing semicolon in the statement INSP.protected.member.ignore.annotations=Ignore annotations @@ -493,11 +493,11 @@ INSP.stub.packages.compatibility.incompatible.packages.message=''{0}{1}{2}'' is INSP.arguments.not.declared.but.provided.by.decorator=Following arguments are not declared but provided by decorator: {0} INSP.pep8.coding.style.violation=PEP 8 coding style violation INSP.shadowing.names=Shadowing names from outer scopes -INSP.stub.packages.compatibility=Stub packages compatibility inspection +INSP.stub.packages.compatibility=Incompatible stub packages INSP.stub.packages=Stub packages advertiser # PyCallingNonCallableInspection -INSP.NAME.calling.non.callable=Trying to call a non-callable object +INSP.NAME.calling.non.callable=Attempt to call a non-callable object INSP.class.object.is.not.callable=''{0}'' object is not callable INSP.symbol.is.not.callable=''{0}'' is not callable INSP.expression.is.not.callable=Expression is not callable @@ -514,7 +514,7 @@ INSP.expected.dict.got.type=Expected a dictionary, got {0} INSP.expected.iterable.got.type=Expected an iterable, got {0} # PyMethodParametersInspection -INSP.NAME.problematic.first.parameter=Methods having troubles with first parameter +INSP.NAME.problematic.first.parameter=Improper first parameter INSP.must.have.first.parameter=Method must have a first parameter, usually called ''{0}'' INSP.probably.mistyped.self=Did not you mean 'self'? INSP.usually.named.self=Usually first parameter of a method is named 'self' @@ -526,7 +526,7 @@ INSP.NAME.nested.decorators=Problematic nesting of decorators INSP.decorator.receives.unexpected.builtin=This decorator will not receive a callable it may expect; the built-in decorator returns a special object # PyRedeclarationInspection -INSP.NAME.redeclaration=Redeclared names without usage +INSP.NAME.redeclaration=Redeclared names without usages INSP.redeclared.name=Redeclared ''{0}'' defined above without usage # PyUnresolvedReferencesInspection @@ -534,7 +534,7 @@ INSP.try.except.import.error=''{0}'' in the try block with ''except ImportError' INSP.unused.import.statement=Unused import statement #ref # PyInterpreterInspection -INSP.NAME.invalid.interpreter=Invalid interpreter configured +INSP.NAME.invalid.interpreter=An invalid interpreter INSP.interpreter.pipenv.interpreter.associated.with.another.project=Pipenv interpreter is associated with another project: ''{0}'' INSP.interpreter.pipenv.interpreter.associated.with.another.module=Pipenv interpreter is associated with another module: ''{0}'' INSP.interpreter.pipenv.interpreter.not.associated.with.any.project=Pipenv interpreter is not associated with any project @@ -581,18 +581,18 @@ INSP.new.incompatible.to.init=Signature is not compatible to __init__ INSP.init.incompatible.to.new=Signature is not compatible to __new__ # PyTrailingSemicolonInspection -INSP.NAME.trailing.semicolon=Trailing semicolon in statement +INSP.NAME.trailing.semicolon=Prohibited trailing semicolon in a statement # PyUnboundLocalVariableInspection -INSP.NAME.unbound=Unbound local variable +INSP.NAME.unbound=Unbound local variables INSP.unbound.local.variable=Local variable ''{0}'' might be referenced before assignment INSP.unbound.nonlocal.variable=Nonlocal variable ''{0}'' must be bound in an outer function scope INSP.unbound.name.undefined=Name ''{0}'' can be undefined INSP.unbound.function.too.large=Function ''{0}'' is too large to analyse # PyListCreationInspection -INSP.NAME.list.creation=List creation could be rewritten by list literal +INSP.NAME.list.creation=Non-optimal list declaration INSP.list.creation.this.list.creation.could.be.rewritten.as.list.literal=This list creation could be rewritten as a list literal # PyTupleAssignmentBalanceInspection @@ -608,15 +608,15 @@ INSP.classic.class.usage.old.style.class.ancestors=Old-style class, because all # PyExceptionInheritance -INSP.NAME.exception.not.inherit=Exception doesn't inherit from standard ''Exception'' class +INSP.NAME.exception.not.inherit=Exceptions do not inherit from standard 'Exception' class INSP.exception.inheritance.exception.does.not.inherit.from.base.exception.class=Exception doesn't inherit from base 'Exception' class # PyDefaultArgumentInspection -INSP.NAME.default.argument=Default argument is mutable +INSP.NAME.default.argument=The default argument is mutable INSP.default.arguments.default.argument.value.mutable=Default argument value is mutable # PyDocstringTypesInspection -INSP.NAME.docstring.types=Type in docstring doesn't match inferred type +INSP.NAME.docstring.types=Type in docstring does not match inferred type INSP.docstring.types.dynamically.inferred.type.does.not.match.specified.type=Dynamically inferred type ''{0}'' doesn''t match specified type ''{1}'' # PyStatementEffectInspection @@ -640,17 +640,17 @@ INSP.mandatory.encoding.checkbox.enable.in.python.3=Enable in Python 3+ INSP.mandatory.encoding.no.encoding.specified.for.file=No encoding specified for file # PyTupleItemAssignmentInspection -INSP.NAME.tuple.item.assignment=Tuple item assignment +INSP.NAME.tuple.item.assignment=Tuple item assignment is prohibited INSP.tuples.never.assign.items=Tuples don't support item assignment # PyPropertyAccessInspection -INSP.NAME.property.access=Access to properties +INSP.NAME.property.access=Inappropriate access to properties INSP.property.cannot.be.set=Property ''{0}'' cannot be set INSP.property.cannot.be.read=Property ''{0}'' cannot be read INSP.property.cannot.be.deleted=Property ''{0}'' cannot be deleted # PyPropertyDefinitionInspection -INSP.NAME.property.definition=Property definitions +INSP.NAME.property.definition=Incorrect property definition INSP.doc.param.should.be.str=The doc parameter should be a string INSP.strange.arg.want.callable=Strange argument; a callable is expected INSP.func.property.name.mismatch=Names of function and decorator don't match; property accessor is not created @@ -662,7 +662,7 @@ INSP.setter.signature.advice=Setter signature should be (self, value) INSP.deleter.signature.advice=Deleter signature should be (self) # PyProtectedMemberInspection -INSP.NAME.protected.member=Access to a protected member of a class or a module +INSP.NAME.protected.member=Accessing a protected member of a class or a module INSP.protected.member.access.to.protected.member.of.class=Access to a protected member {0} of a class INSP.protected.member.access.to.protected.member.of.module=Access to a protected member {0} of a module INSP.protected.member.name.not.declared.in.all=''{0}'' is not declared in __all__ @@ -674,7 +674,7 @@ INSP.oldstyle.class.getattribute=Old-style class contains __getattribute__ defin INSP.oldstyle.class.super=Old-style class contains call for super method # PyCompatibilityInspection -INSP.NAME.compatibility=Code compatibility inspection +INSP.NAME.compatibility=Code is incompatible with specific Python versions INSP.compatibility.this.syntax.available.only.since.py3=This syntax available only since Python 3 INSP.compatibility.check.for.compatibility.with.python.versions=Check for compatibility with python versions: INSP.compatibility.inspection.unsupported.feature.prefix=Python {0,choice,1#version|2#versions} {1} {0,choice,1#does|2#do} not {2} @@ -736,18 +736,18 @@ INSP.NAME.single.quoted.docstring=Single quoted docstring INSP.message.single.quoted.docstring=Triple double-quoted strings should be used for docstrings. # PyMissingConstructorInspection -INSP.NAME.missing.super.constructor=Missed call to __init__ of super class +INSP.NAME.missing.super.constructor=Missed call to '__init__' of the super class INSP.missing.super.constructor.message=Call to __init__ of super class is missed # PySetFunctionToLiteralInspection INSP.NAME.set.function.to.literal=Function call can be replaced with set literal # PyDecoratorInspection -INSP.NAME.decorator.outside.class=Class specific decorator on method outside class +INSP.NAME.decorator.outside.class=Class-specific decorator is used outside the class INSP.decorators.method.only.decorator.on.method.outside.class=Decorator {0} on a method outside the class # PyPackageRequirementsInspection -INSP.NAME.requirements=Package requirements +INSP.NAME.requirements=Unsatisfied package requirements INSP.requirements.column.name.ignore.packages=Ignore Packages INSP.requirements.ignore.packages.label=Ignored packages: INSP.requirements.package.requirements.not.satisfied=Package {1,choice,1#requirement|2#requirements} {0} {1,choice,1#is|2#are} not satisfied @@ -756,18 +756,18 @@ QFIX.NAME.install.requirements=Install {0,choice,1#requirement|2#requirements} QFIX.NAME.ignore.requirements=Ignore {0,choice,1#requirement|2#requirements} # PyClassHasNoInitInspection -INSP.NAME.class.has.no.init=Class has no __init__ method +INSP.NAME.class.has.no.init=Class has no `__init__` method INSP.class.has.no.init=Class has no __init__ method #PyNoneFunctionAssignmentInspection -INSP.NAME.none.function.assignment=Assigning function call that doesn't return anything +INSP.NAME.none.function.assignment=Assigning function calls that don't return anything INSP.none.function.assignment=Function ''{0}'' doesn''t return anything # PyTestParametrizedInspection -INSP.NAME.pytest-parametrized=Checks that functions decorated by pytest parametrize have correct arguments +INSP.NAME.pytest-parametrized=Incorrect arguments in @pytest.mark.parametrize # PyUnusedLocalInspection -INSP.NAME.unused=Unused local +INSP.NAME.unused=Unused local symbols INSP.unused.locals.parameter.isnot.used=Parameter ''{0}'' value is not used INSP.unused.locals.local.variable.isnot.used=Local variable ''{0}'' value is not used INSP.unused.locals.replace.with.wildcard=Replace with _ @@ -780,7 +780,7 @@ INSP.unused.locals.ignore.lambda.parameters=Ignore lambda parameters INSP.unused.locals.ignore.variables.used.in.tuple.unpacking=Ignore variables used in tuple unpacking # PyChainedComparsonsInspection -INSP.NAME.chained.comparisons=Chained comparisons can be simplified +INSP.NAME.chained.comparisons=Too complex chained comparisons INSP.chained.comparisons.ignore.statements.with.constant.in.the.middle=Ignore statements with a constant in the middle INSP.simplify.chained.comparison=Simplify chained comparison @@ -789,19 +789,19 @@ INSP.NAME.augment.assignment=Assignment can be replaced with augmented assignmen INSP.assignment.can.be.replaced.with.augmented.assignment=Assignment can be replaced with an augmented assignment # PyBroadExceptionInspection -INSP.NAME.too.broad.exception.clauses=Too broad exception clauses +INSP.NAME.too.broad.exception.clauses=Unclear exception clauses INSP.too.broad.exception.clause=Too broad exception clause # PyByteLiteralInspection -INSP.NAME.byte.literal=Byte literal contains characters > 255 +INSP.NAME.byte.literal=A byte literal contains a non-ASCII character INSP.byte.literal.contains.illegal.characters=Byte literal contains characters > 255 # PyComparisonWithNoneInspection -INSP.NAME.comparison.with.none=Comparison with None performed with equality operators +INSP.NAME.comparison.with.none=Using equality operators to compare with None INSP.comparison.with.none.performed.with.equality.operators=Comparison with None performed with equality operators # PyDictCreationInspection -INSP.NAME.dict.creation=Dictionary creation could be rewritten by dictionary literal +INSP.NAME.dict.creation=Dictionary creation can be rewritten by dictionary literal INSP.dict.creation.this.dictionary.creation.could.be.rewritten.as.dictionary.literal=This dictionary creation could be rewritten as a dictionary literal # PyDictDuplicateKeysInspection @@ -809,15 +809,15 @@ INSP.NAME.duplicate.keys=Dictionary contains duplicate keys INSP.duplicate.keys.dictionary.contains.duplicate.keys=Dictionary contains duplicate keys ''{0}'' # PyFromFutureImportInspection -INSP.NAME.from.future.import=from __future__ import must be the first executable statement +INSP.NAME.from.future.import=Improper position of from __future__ import INSP.from.future.import.from.future.imports.must.occur.at.beginning.file=from __future__ imports must occur at the beginning of the file # PyMethodFirstArgAssignmentInspection -INSP.NAME.first.arg.assign=Reassignment of method's first argument +INSP.NAME.first.arg.assign=First argument of the method is reassigned INSP.first.arg.assign.method.parameter.reassigned=Method''s parameter ''{0}'' reassigned # PyMethodMayBeStaticInspection -INSP.NAME.method.may.be.static=Method may be static +INSP.NAME.method.may.be.static=Method is not declared static INSP.method.may.be.static=Method #ref may be 'static' # PyAbstractClassInspection @@ -825,19 +825,19 @@ INSP.NAME.abstract.class=Class must implement all abstract methods INSP.abstract.class.class.must.implement.all.abstract.methods=Class {0} must implement all abstract methods #PyAssignmentToLoopOrWithParameterInspection -INSP.NAME.assignment.to.loop.or.with.parameter=Assignment to 'for' loop or 'with' statement parameter +INSP.NAME.assignment.to.loop.or.with.parameter=Assignments to 'for' loop or 'with' statement parameter INSP.assignment.to.loop.or.with.parameter=Variable ''{0}'' is already declared in ''for'' loop or ''with'' statement above # PyArgumentEqualDefaultInspection -INSP.NAME.argument.equal.default=Argument passed to function is equal to default parameter value +INSP.NAME.argument.equal.default=The function argument is equal to the default parameter value INSP.argument.equals.to.default=Argument equals to the default parameter value #PyAsyncCallInspection INSP.NAME.coroutine.is.not.awaited=Coroutine ''{0}'' is not awaited -INSP.async.call=Coroutine is not awaited +INSP.async.call=Missing `await` syntax in coroutine calls # PyAttributeOutsideInitInspection -INSP.NAME.attribute.outside.init=Instance attribute defined outside __init__ +INSP.NAME.attribute.outside.init=An instance attribute is defined outside `__init__` INSP.attribute.outside.init=Instance attribute {0} defined outside __init__ # PyMissingOrEmptyDocstringInspection @@ -868,7 +868,7 @@ INSP.redundant.parens.ignore.tuples=Ignore tuples INSP.redundant.parens.ignore.argument.of.operator=Ignore argument of % operator # PySimplifyBooleanCheckInspection -INSP.NAME.check.can.be.simplified=Boolean variable check can be simplified +INSP.NAME.check.can.be.simplified=Redundant boolean variable check INSP.expression.can.be.simplified=Expression can be simplified INSP.simplify.boolean.check.ignore.comparison.to.zero=Ignore comparison to zero @@ -878,16 +878,16 @@ INSP.missing.parameter.in.docstring=Missing parameter {0} in docstring INSP.unexpected.parameter.in.docstring=Unexpected parameter {0} in docstring # PyExceptClausesOrderInspection -INSP.NAME.bad.except.clauses.order=Bad except clauses order +INSP.NAME.bad.except.clauses.order=Wrong order of 'except' clauses INSP.bad.except.exception.class.already.caught=Exception class ''{0}'' has already been caught INSP.bad.except.superclass.of.exception.class.already.caught=''{0}'', superclass of the exception class ''{1}'', has already been caught #PyGlobalUndefinedInspection -INSP.NAME.global.undefined=Global variable is undefined at the module level +INSP.NAME.global.undefined=Global variable is not defined at the module level INSP.global.variable.undefined=Global variable ''{0}'' is undefined at the module level #PyDataclassInspection -INSP.NAME.dataclass.definition.and.usages=Dataclass definition and usages +INSP.NAME.dataclass.definition.and.usages=Invalid definition and usage of Data Classes INSP.dataclasses.operator.not.supported.between.instances.of.class=''{0}'' not supported between instances of ''{1}'' INSP.dataclasses.operator.not.supported.between.instances.of.classes=''{0}'' not supported between instances of ''{1}'' and ''{2}'' INSP.dataclasses.object.could.have.no.attribute.because.it.declared.as.init.only=''{0}'' object could have no attribute ''{1}'' because it is declared as init-only @@ -927,12 +927,12 @@ INSP.NAME.deprecated.function.class.or.module=Deprecated function, class, or mod INSP.deprecation.abc.decorator.deprecated.use.alternative=''{0}'' is deprecated since Python 3.3. Use ''{1}'' with ''{2}'' instead # PyDunderSlotsInspection -INSP.NAME.dunder.slots=Definition of __slots__ in a class +INSP.NAME.dunder.slots=Invalid usages of classes with '__slots__' definitions INSP.dunder.slots.name.in.slots.conflicts.with.class.variable=''{0}'' in __slots__ conflicts with a class variable INSP.dunder.slots.class.object.attribute.read.only=''{0}'' object attribute ''{1}'' is read-only # PyFinalInspection -INSP.NAME.final.classes.methods.and.variables=Final classes, methods, and variables +INSP.NAME.final.classes.methods.and.variables=Invalid usages of final classes, methods, and variables INSP.final.super.classes.are.marked.as.final.and.should.not.be.subclassed={0} {1,choice,1#is|2#are} marked as ''@final'' and should not be subclassed INSP.final.final.should.be.placed.on.first.overload='@final' should be placed on the first overload INSP.final.method.marked.as.final.should.not.be.overridden=''{0}'' is marked as ''@final'' and should not be overridden @@ -988,14 +988,14 @@ INSP.pep8.naming.camelcase.variable.imported.as.lowercase=CamelCase variable imp INSP.pep8.naming.camelcase.variable.imported.as.constant=CamelCase variable imported as constant # PyProtocolInspection -INSP.NAME.protocol.definition.and.usages=Protocol definition and usages +INSP.NAME.protocol.definition.and.usages=Invalid protocol definitions and usages INSP.protocol.all.bases.protocol.must.be.protocols=All bases of a protocol must be protocols INSP.protocol.only.runtime.checkable.protocols.can.be.used.with.instance.class.checks=Only @runtime_checkable protocols can be used with instance and class checks INSP.protocol.newtype.cannot.be.used.with.protocol.classes=NewType cannot be used with protocol classes INSP.protocol.element.type.incompatible.with.protocol=Type of ''{0}'' is incompatible with ''{1}'' # PyShadowingBuiltinsInspection -INSP.NAME.shadowing.builtins=Shadowing built-ins +INSP.NAME.shadowing.builtins=Shadowing built-in names INSP.shadowing.builtins.shadows.built.in.name=Shadows built-in name ''{0}'' INSP.shadowing.builtins.column.name.ignore.built.ins=Ignore Built-Ins INSP.shadowing.builtins.ignore.built.ins.label=Ignored built-ins: @@ -1003,7 +1003,7 @@ QFIX.NAME.ignore.shadowed.built.in.name=Ignore shadowed built-in name QFIX.ignore.shadowed.built.in.name=Ignore shadowed built-in name "{0}" # PyTypeCheckerInspection -INSP.NAME.type.checker=Type checker +INSP.NAME.type.checker=Incorrect type INSP.type.checker.expected.type.got.type.instead=Expected type ''{0}'', got ''{1}'' instead INSP.type.checker.expected.to.return.type.got.no.return=Expected to return ''{0}'', got no return INSP.type.checker.init.should.return.none=__init__ should return None @@ -1015,7 +1015,7 @@ INSP.type.checker.unexpected.types.prefix=Unexpected type(s): INSP.type.checker.expected.types.prefix=Possible type(s): # PyTypedDictInspection -INSP.NAME.typed.dict=TypedDict definition and usages +INSP.NAME.typed.dict=Invalid TypedDict definition and usages INSP.typeddict.typeddict.key.must.be.string.literal.expected.one=TypedDict key must be a string literal; expected one of ({0}) INSP.typeddict.typeddict.has.no.key=TypedDict "{0}" has no key ''{1}'' INSP.typeddict.typeddict.has.no.keys=TypedDict "{0}" has no keys ({1}) @@ -1035,7 +1035,7 @@ INSP.typeddict.typeddict.cannot.have.key=TypedDict "{0}" cannot have key ''{1}'' INSP.typeddict.cannot.add.non.string.key.to.typeddict=Cannot add a non-string key to TypedDict "{0}" # PyTypeHintsInspection -INSP.NAME.type.hints=Type hints definitions and usages +INSP.NAME.type.hints=Invalid type hints definitions and usages INSP.type.hints.builtin.cannot.be.parameterized.directly=Builtin ''{0}'' cannot be parameterized directly INSP.type.hints.invalid.type.self=Invalid type 'self' INSP.type.hints.literal.must.have.at.least.one.parameter='Literal' must have at least one parameter @@ -1103,7 +1103,7 @@ python.find.usages.untyped.probable.usage=Untyped (probable) usage python.find.usages.usage.in.import.statement=Usage in an import statement # PyPackagesInspection -INSP.NAME.relative.import=Suspicious relative import +INSP.NAME.relative.import=Suspicious relative imports INSP.relative.import.relative.import.outside.package=Relative import outside of a package debugger.cleaning.signature.cache=Cleaning the Cache of Dynamically Collected Types diff --git a/python/testSrc/com/jetbrains/python/PyQuickFixTest.java b/python/testSrc/com/jetbrains/python/PyQuickFixTest.java index b904e9ceb68b..f66ebcc0a0e1 100644 --- a/python/testSrc/com/jetbrains/python/PyQuickFixTest.java +++ b/python/testSrc/com/jetbrains/python/PyQuickFixTest.java @@ -133,7 +133,12 @@ public class PyQuickFixTest extends PyTestCase { // PY-22045 public void testBatchReplacePrintInsertsFutureImportOnlyOnce() { - doInspectionTest(PyCompatibilityInspection.class, "Fix all 'Code compatibility inspection' problems in file", true, true); + doInspectionTest( + PyCompatibilityInspection.class, + "Fix all 'Code is incompatible with specific Python versions' problems in file", + true, + true + ); } // PY-4556 diff --git a/python/testSrc/com/jetbrains/python/quickFixes/PyTypeHintsQuickFixTest.kt b/python/testSrc/com/jetbrains/python/quickFixes/PyTypeHintsQuickFixTest.kt index acd38e8663ae..3a3b2652ab7e 100644 --- a/python/testSrc/com/jetbrains/python/quickFixes/PyTypeHintsQuickFixTest.kt +++ b/python/testSrc/com/jetbrains/python/quickFixes/PyTypeHintsQuickFixTest.kt @@ -157,7 +157,7 @@ class PyTypeHintsQuickFixTest : PyQuickFixTestCase() { // PY-42418 fun testBatchReplacingParameterizedBuiltinsWithTheirTypingAliasesBefore39() { doQuickFixTest(PyTypeHintsInspection::class.java, - "Fix all 'Type hints definitions and usages' problems in file", + "Fix all 'Invalid type hints definitions and usages' problems in file", LanguageLevel.PYTHON38) } }