4

If you run pylint --generate-rcfile > pylintrc and look at the default rc file you'll see the following list of disabled warnings.

Why are they disabled by default?

disable=print-statement,
        parameter-unpacking,
        unpacking-in-except,
        old-raise-syntax,
        backtick,
        long-suffix,
        old-ne-operator,
        old-octal-literal,
        import-star-module-level,
        non-ascii-bytes-literal,
        raw-checker-failed,
        bad-inline-option,
        locally-disabled,
        locally-enabled,
        file-ignored,
        suppressed-message,
        useless-suppression,
        deprecated-pragma,
        apply-builtin,
        basestring-builtin,
        buffer-builtin,
        cmp-builtin,
        coerce-builtin,
        execfile-builtin,
        file-builtin,
        long-builtin,
        raw_input-builtin,
        reduce-builtin,
        standarderror-builtin,
        unicode-builtin,
        xrange-builtin,
        coerce-method,
        delslice-method,
        getslice-method,
        setslice-method,
        no-absolute-import,
        old-division,
           dict-iter-method,
        dict-view-method,
        next-method-called,
        metaclass-assignment,
        indexing-exception,
        raising-string,
        reload-builtin,
        oct-method,
        hex-method,
        nonzero-method,
        cmp-method,
        input-builtin,
        round-builtin,
        intern-builtin,
        unichr-builtin,
        map-builtin-not-iterating,
        zip-builtin-not-iterating,
        range-builtin-not-iterating,
        filter-builtin-not-iterating,
        using-cmp-argument,
        eq-without-hash,
        div-method,
        idiv-method,
        rdiv-method,
        exception-message-attribute,
        invalid-str-codec,
        sys-max-int,
        bad-python3-import,
        deprecated-string-function,
        deprecated-str-translate-call,
        deprecated-itertools-function,
        deprecated-types-field,
        next-method-defined,
        dict-items-not-iterating,
        dict-keys-not-iterating,
        dict-values-not-iterating

AlexLordThorsen
  • 8,057
  • 5
  • 48
  • 103
  • I suspect that's a list of *all* warnings that can be disabled, so that you can simply delete or comment out the ones you don't want to disable. – chepner Mar 06 '19 at 20:17

2 Answers2

4

From the documentation's Frequently Asked Questions...

Why are there a bunch of messages disabled by default?

pylint does have some messages disabled by default, either because they are prone to false positives or that they are opinionated enough for not being included as default messages. But most of the disabled messages are from the Python 3 porting checker, which is disabled by default. It needs special activation with the --py3k flag.

Mat
  • 833
  • 1
  • 5
  • 20
2

I think that such default rc file is designed to apply pylint to python2 code without tons of errors and warnings. Note: most of the disabled statements belongs to python2 syntax and standard library api:

  • print-statement - print was a statement in Python2, in Python3 it is a function
  • old-raise-syntax - there was except Exception, e syntax that is invalid for Python3, in Python3 except Exception as e is only valid
  • xrange-builtin - xrange was replaced with range
  • etc.

So, with this default rc you can use pylint for python2 code to find out such things as redefined-outer-name, line-too-long and other bad things without getting annoying errors and warnings for valid Python2 syntax and standard library calls.

sanyassh
  • 8,100
  • 13
  • 36
  • 70