检查注释对照表

注释对应检查说明
# noinspection PyUnusedLocalThis inspection highlights local variables,parameters or local functions unused in scope.
# noinspection PyUnresolvedReferencesThis 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.
# noinspection PyUnreachableCodeThis inspection detects code which can not be normally reached.
# noinspection PyUnboundLocalVariableThis inspection warns about local variables referenced before assignment.
# noinspection PyUnnecessaryBackslashThis inspection highlights backslashes in places where line continuation is implicit (inside (), [], {}).
# noinspection PyAbstractClassThis inspection detects when not all abstract properties/methods are defined in a subclass
# noinspection PyArgumentListThis inspection 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.
# noinspection PyArgumentEqualDefaultThis inspection highlights situations, where argument passed to function is equal to default parameter value
# noinspection PyAssignmentToLoopOrWithParameterChecks for cases when you rewrite loop variable with inner loop for i in xrange(5): for i in xrange(20, 25): print(“Inner”, i) print(“Outer”, i)It also warns you if variable declared in with statement is redeclared inside of statement body: with open(“file”) as f: f.read() with open(“file”) as f:
# noinspection PyAsyncCallThis inspection highlights coroutines which were called without await
# noinspection PyAugmentAssignmentThis inspection highlights assignment that can be replaced with augmented assignment.
# noinspection PyAttributeOutsideInitThis inspection detects instance attribute definition outside init method
# noinspection PyBroadExceptionThis inspection highlights too broad exception clauses such as no exception class specified, or specified as ‘Exception’.
# noinspection PyByteLiteralThis inspection detects characters > 255 in byte literals.
# noinspection PyCallByClassThis inspection checks for calls of a method by class while passing an instance of a different class as self parameter: foo = Foo() Bar.baz(foo, *more)Sometimes this may be intentional and correct. But when unintentional, this leads to subtle bugs.
# noinspection PyCallingNonCallableThis inspection highlights attempts to call objects which are not callable, like, for example, tuples.
# noinspection PyChainedComparisonsThis inspection highlights chained comparisons that can be simplified.
# noinspection PyClassHasNoInitThis inspection used when a class has no init method, neither its parent classes.
# noinspection PyClassicStyleClassThis inspection detects classic style classes usage.
# noinspection PyComparisonWithNoneThis inspection highlights comparisons with None. That type of comparisons should always be done with ‘is’ or ‘is not’, never the equality operators.
# noinspection PyCompatibilityEnable 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.
# noinspection PyDataclassThis inspection detects invalid definitions and usages of classes created with dataclasses or attr modules.
# noinspection PyDecoratorThis inspection reports usages of @classmethod or @staticmethod decorators on functions outside of a class.
# noinspection PyDefaultArgumentThis 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.
# noinspection PyDeprecationThis inspection highlights usages of Python functions, classes or methods which are marked as deprecated (which raise a DeprecationWarning or a PendingDeprecationWarning).
# noinspection PyDictCreationThis inspection detects situations when dictionary creation could be rewritten with dictionary literal.
# noinspection PyDictDuplicateKeysThis inspection highlights using the same value as dictionary key twice.
# noinspection PyDocstringTypesThis inspection highlights types in docstring which don’t match dynamically inferred types.
# noinspection PyDunderSlotsThis inspection detects invalid definition of slots in a class.
# noinspection PyExceptClausesOrderThis 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.
# noinspection PyExceptionInheritThis inspection detects when a custom exception class is raised but doesn’t inherit from the builtin “Exception” class.
# noinspection PyFromFutureImportThis inspection detects ‘from future import’ statements which are used not in the beginning of a file.
# noinspection PyGlobalUndefinedThis inspection is used when a variable is defined through the “global” statement but the variable is not defined in the module scope.
# noinspection PyInconsistentIndentationThis inspection reports inconsistent indentation in Python source files (for example, use of a mixture of tabs and spaces).
# noinspection PyIncorrectDocstringThis 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.
# noinspection PyInitNewSignatureThis inspection checks mutual compatibility of new and init signatures.
# noinspection PyInterpreterThis inspection notifies you if the current project has no Python interpreter configured or an invalid Python interpreter.
# noinspection PyListCreationThis inspection detects situations when list creation could be rewritten with list literal.
# noinspection PyMandatoryEncodingThis inspection detects lack of encoding magic comment for file.
# noinspection PyMethodFirstArgAssignmentThis 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.
# noinspection PyMethodMayBeStaticThis inspection detects any methods which may safely be made static.
# noinspection PyMethodOverridingThis inspection detects inconsistencies in overriding method signatures.
# noinspection PyMethodParametersThis inspection looks for methods that lack a first parameter (which is usually named self ).
# noinspection PyMissingConstructorThis inspection warns if call to super constructor in class is missed
# noinspection PyMissingOrEmptyDocstringThis inspection detects lack of docstring and an empty docstring.
# noinspection PyMissingTypeHintsThis inspection detects lack of type hints for function declaration in one of the two formats: parameter annotations or a type comment
# noinspection PyNamedTupleThis inspection detects invalid definition of namedtuple.
# noinspection PyNestedDecoratorsThis inspection looks for certain decorators that don’t nest well.
# noinspection PyNonAsciiCharThis inspection detects file contains non-ASCII characters and doesn’t have an encoding declaration at the top.
# noinspection PyNoneFunctionAssignmentThis 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.
# noinspection PyOldStyleClassesThis inspection highlights occurrences of new-style class features in old-style classes.
# noinspection PyOverloadsThis inspection validates overloads in regular Python files.
# noinspection PyPackageRequirementsThis inspection warns about imported or required, but not installed packages.
# noinspection PyPep8This inspection runs the pep8.py tool to check for violations of the PEP 8 coding style guide.
# noinspection PyPep8NamingThis inspection checks the PEP8 naming conventions.
# noinspection PyPropertyAccessThis inspection checks that properties are accessed correctly: read-only not set, write-only not read, non-deletable not deleted.
# noinspection PyPropertyDefinitionThis inspection checks that arguments to property() and functions annotated with @property and friends look reasonably.
# noinspection PyProtectedMemberThis inspection warns if a protected member is accessed outside the class, a descendant of the class where it’s defined or a module.
# noinspection PyProtocolThis inspection detects invalid definitions and usages of protocols introduced in PEP-544.
# noinspection PyRedeclarationThis inspection detects unconditional redeclarations of names without being used in between, like this: def x(): passx = 2It applies to function and class declarations, and top-level assignments.
# noinspection PyRedundantParenthesesThis inspection highlights redundant parentheses in statements.
# noinspection PyReturnFromInitThis inspection reports occurrences of return statements with a return value inside init methods of classes. A constructor should not return any value.
# noinspection PySetFunctionToLiteralThis inspection detects call for function “set” which can be replaced with set literal.
# noinspection PyShadowingBuiltinsThis inspection detects shadowing built-in names, such as ‘len’ or ‘list’.
# noinspection PyShadowingNamesThis inspection detects shadowing names defined in outer scopes
# noinspection PySimplifyBooleanCheckThis inspection detects equality comparison with a boolean literal.
# noinspection PySingleQuotedDocstringThis inspection highlights docstrings not using triple double-quoted string format.
# noinspection PyStatementEffectThis inspection detects statements without any effect.
# noinspection PyStringExceptionThis inspection detects when a string exception is raised.
# noinspection PyStringFormatThis inspection detects errors in string formatting operations.
# noinspection PySuperArgumentsThis inspection check that in any call to super(A, B), B either is an instance of A or a subclass of A.
# noinspection PyTestParametrizedTest function, decorated with @pytest.mark.parametrize, must have arguments to accept parameters from decorator
# noinspection PyTrailingSemicolonThis inspection detects trailing semicolons in statements.
# noinspection PyTupleAssignmentBalanceThis inspection check that the number of expressions on right-hand side and targets on left-hand side are the same.
# noinspection PyTupleItemAssignmentThis inspection detects assignments to tuple item.
# noinspection PyTypeCheckerThis 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.
# noinspection PyTypeHintsThis inspection detects invalid usages of type hints.
  • 0
    点赞
  • 6
    收藏
    觉得还不错? 一键收藏
  • 1
    评论

“相关推荐”对你有帮助么?

  • 非常没帮助
  • 没帮助
  • 一般
  • 有帮助
  • 非常有帮助
提交
评论 1
添加红包

请填写红包祝福语或标题

红包个数最小为10个

红包金额最低5元

当前余额3.43前往充值 >
需支付:10.00
成就一亿技术人!
领取后你会自动成为博主和红包主的粉丝 规则
hope_wisdom
发出的红包
实付
使用余额支付
点击重新获取
扫码支付
钱包余额 0

抵扣说明:

1.余额是钱包充值的虚拟货币,按照1:1的比例进行支付金额的抵扣。
2.余额无法直接购买下载,可以购买VIP、付费专栏及课程。

余额充值