Skip to content

PyCharm:Inspections

PyCharm에서 확인할 수 있는 inspection 목록.

Suppressing comments

# noinspection PyPep8 또는 # noinspection PyPep8, PyPep8Naming 와 같은 느낌으로 주석처리하면 된다.

  • PyPep8
  • PyPep8Naming
  • PyTypeChecker
    • Unexpected type(s): {...} Possible type(s): {...}
    • Expected type '...', got '...' instead
  • PyAbstractClass
  • PyArgumentEqualDefault
  • PyArgumentList
    • Unexpected argument
  • PyAssignmentToLoopOrWithParameter
  • PyAttributeOutsideInit
  • PyAugmentAssignment
  • PyBroadException
  • PyByteLiteral
  • PyCallByClass
  • PyChainedComparsons
  • PyClassHasNoInit
  • PyClassicStyleClass
  • PyComparisonWithNone
  • PyCompatibility
  • PyDecorator
  • PyDefaultArgument
  • PyDictCreation
  • PyDictDuplicateKeys
  • PyDocstringTypes
  • PyExceptClausesOrder
  • PyExceptionInheritance
  • PyFromFutureImport
  • PyGlobalUndefined
  • PyIncorrectDocstring
  • PyInitNewSignature
  • PyInterpreter
  • PyListCreation
  • PyMandatoryEncoding
  • PyMethodFirstArgAssignment
  • PyMethodMayBeStatic
    • Method 'xxx' may be 'static'
  • PyMethodOverriding
  • PyMethodParameters
    • Usually first parameter of a method is named '{...}'
  • PyMissingConstructor
  • PyMissingOrEmptyDocstring
  • PyNestedDecorators
  • PythonAsciiChar
  • PyNoneFunctionAssignment
  • PyOldStyleClasses
  • PyPackageRequirements
    • Package containing module '{MODULE_NAME}' is not listed in the project requirements
  • PyPropertyAccess
  • PyPropertyDefinition
  • PyProtectedMember
    • Access to a protected member '{_member_name}' of a module
  • PyProtocol
    • Type of '{member_name}' is incompatible with '{protocol_type}'
  • PyRaisingNewStyleClass
  • PyRedeclaration
  • PyRedundantParentheses
  • PySetFunctionToLiteral
  • PyShadowingBuiltins
    • Shadows built-in name {...}
  • PySimplifyBooleanCheck
  • PySingleQuotedDocstring
  • PyStatementEffect
  • PyStringException
  • PyStringFormat
  • PySuperArguments
  • PyTrailingSemicolon
  • PyTupleAssignmentBalance
  • PyTupleItemAssignment
  • PyUnboundLocalVariable
  • PyUnnecessaryBackslash
  • PyUnreachableCode
  • PyUnresolvedReferences
    • ModuleNotFoundError: No module named '...'
    • '...' in the try block with 'except ImportError' should also be defined in the except block
    • Cannot find reference
    • Unresolved attribute reference '...' for class '...'
  • PyUnusedLocal
  • ReturnValueFromInit
  • PyAsyncCall
  • PyTestParametrized
  • DuplicatedCode
  • SpellCheckingInspection
    • Typo errors.
  • PyCallingNonCallable
    • '...' object is not callable

noinspection example

아래와 같이 noinspection를 주석으로 추가하면 된다.

    # noinspection PyUnusedLocal, PyUnreachableCode
    def on_show(self, event):
        if not self.name:
            wx.MessageBox(lang.NAME_IS_EMPTY, lang.INFO, wx.OK | wx.ICON_INFORMATION)
            self.Close()

Find script

$ unzip -p lib/pycharm.jar com/jetbrains/python/PyBundle.properties | grep -B1 INSP.NAME | grep '^#' | sed 's|Inspection||g' | sed -e 's|#\s\{,1\}|# noinspection |'

See also

Favorite site