|
| 1 | +[MASTER] |
| 2 | +load-plugins=pylint.extensions.bad_builtin, |
| 3 | + pylint.extensions.check_elif, |
| 4 | + pylint.extensions.code_style, |
| 5 | + pylint.extensions.dict_init_mutate, |
| 6 | + pylint.extensions.docstyle, |
| 7 | + pylint.extensions.dunder, |
| 8 | + pylint.extensions.comparison_placement, |
| 9 | + pylint.extensions.confusing_elif, |
| 10 | + pylint.extensions.for_any_all, |
| 11 | + pylint.extensions.consider_refactoring_into_while_condition, |
| 12 | + pylint.extensions.mccabe, |
| 13 | + pylint.extensions.eq_without_hash, |
| 14 | + pylint.extensions.redefined_variable_type, |
| 15 | + pylint.extensions.overlapping_exceptions, |
| 16 | + pylint.extensions.docparams, |
| 17 | + pylint.extensions.private_import, |
| 18 | + pylint.extensions.set_membership, |
| 19 | + pylint.extensions.typing, |
| 20 | + |
| 21 | +# magic_value wants you to not use arbitrary strings and numbers |
| 22 | +# inline in the code. But it's overzealous and has way too many false |
| 23 | +# positives. Trust people to do the most readable thing. |
| 24 | +# pylint.extensions.magic_value |
| 25 | + |
| 26 | +# Empty comment would be good, except it detects blank lines within |
| 27 | +# a single comment block. |
| 28 | +# |
| 29 | +# Those are often used to separate paragraphs, like here. |
| 30 | +# pylint.extensions.empty_comment, |
| 31 | + |
| 32 | +# consider_ternary_expression is a nice check, but is also overzealous. |
| 33 | +# Trust the human to do the readable thing. |
| 34 | +# pylint.extensions.consider_ternary_expression, |
| 35 | + |
| 36 | +# redefined_loop_name tends to catch us with things like |
| 37 | +# for name in (a, b, c): name = name + '_column' ... |
| 38 | +# pylint.extensions.redefined_loop_name, |
| 39 | + |
| 40 | +# This wants you to turn ``x in (1, 2)`` into ``x in {1, 2}``. |
| 41 | +# They both result in the LOAD_CONST bytecode, one a tuple one a |
| 42 | +# frozenset. In theory a set lookup using hashing is faster than |
| 43 | +# a linear scan of a tuple; but if the tuple is small, it can often |
| 44 | +# actually be faster to scan the tuple. |
| 45 | +# pylint.extensions.set_membership, |
| 46 | + |
| 47 | +# Fix zope.cachedescriptors.property.Lazy; the property-classes doesn't seem to |
| 48 | +# do anything. |
| 49 | +# https://stackoverflow.com/questions/51160955/pylint-how-to-specify-a-self-defined-property-decorator-with-property-classes |
| 50 | +# For releases prior to 2.14.2, this needs to be a one-line, quoted string. After that, |
| 51 | +# a multi-line string. |
| 52 | +# - Make zope.cachedescriptors.property.Lazy look like a property; |
| 53 | +# fixes pylint thinking it is a method. |
| 54 | +# - Run in Pure Python mode (ignore C extensions that respect this); |
| 55 | +# fixes some issues with zope.interface, like IFoo.providedby(ob) |
| 56 | +# claiming not to have the right number of parameters...except no, it does not. |
| 57 | +init-hook = |
| 58 | + import astroid.bases |
| 59 | + astroid.bases.POSSIBLE_PROPERTIES.add('Lazy') |
| 60 | + astroid.bases.POSSIBLE_PROPERTIES.add('LazyOnClass') |
| 61 | + astroid.bases.POSSIBLE_PROPERTIES.add('readproperty') |
| 62 | + astroid.bases.POSSIBLE_PROPERTIES.add('non_overridable') |
| 63 | + import os |
| 64 | + os.environ['PURE_PYTHON'] = ("1") |
| 65 | + # Ending on a quoted string |
| 66 | + # breaks pylint 2.14.5 (it strips the trailing quote. This is |
| 67 | + # probably because it tries to handle one-line quoted strings as well as multi-blocks). |
| 68 | + # The parens around it fix the issue. |
| 69 | + |
| 70 | + |
| 71 | +[MESSAGES CONTROL] |
| 72 | + |
| 73 | +# Disable the message, report, category or checker with the given id(s). You |
| 74 | +# can either give multiple identifier separated by comma (,) or put this option |
| 75 | +# multiple time (only on the command line, not in the configuration file where |
| 76 | +# it should appear only once). |
| 77 | +# NOTE: comments must go ABOVE the statement. In Python 2, mixing in |
| 78 | +# comments disables all directives that follow, while in Python 3, putting |
| 79 | +# comments at the end of the line does the same thing (though Py3 supports |
| 80 | +# mixing) |
| 81 | + |
| 82 | + |
| 83 | +# invalid-name, ; We get lots of these, especially in scripts. should fix many of them |
| 84 | +# protected-access, ; We have many cases of this; legit ones need to be examinid and commented, then this removed |
| 85 | +# no-self-use, ; common in superclasses with extension points |
| 86 | +# too-few-public-methods, ; Exception and marker classes get tagged with this |
| 87 | +# exec-used, ; should tag individual instances with this, there are some but not too many |
| 88 | +# global-statement, ; should tag individual instances |
| 89 | +# multiple-statements, ; "from gevent import monkey; monkey.patch_all()" |
| 90 | +# locally-disabled, ; yes, we know we're doing this. don't replace one warning with another |
| 91 | +# cyclic-import, ; most of these are deferred imports |
| 92 | +# too-many-arguments, ; these are almost always because that's what the stdlib does |
| 93 | +# redefined-builtin, ; likewise: these tend to be keyword arguments like len= in the stdlib |
| 94 | +# undefined-all-variable, ; XXX: This crashes with pylint 1.5.4 on Travis (but not locally on Py2/3 |
| 95 | +# ; or landscape.io on Py3). The file causing the problem is unclear. UPDATE: identified and disabled |
| 96 | +# that file. |
| 97 | +# see https://github.com/PyCQA/pylint/issues/846 |
| 98 | +# useless-suppression: the only way to avoid repeating it for specific statements everywhere that we |
| 99 | +# do Py2/Py3 stuff is to put it here. Sadly this means that we might get better but not realize it. |
| 100 | +# duplicate-code: Yeah, the compatibility ssl modules are much the same |
| 101 | +# In pylint 1.8.0, inconsistent-return-statements are created for the wrong reasons. |
| 102 | +# This code raises it, even though there is only one return (the implicit ``return None`` is presumably |
| 103 | +# what triggers it): |
| 104 | +# def foo(): |
| 105 | +# if baz: |
| 106 | +# return 1 |
| 107 | +# In Pylint 2dev1, needed for Python 3.7, we get spurious "useless return" errors: |
| 108 | +# @property |
| 109 | +# def foo(self): |
| 110 | +# return None # generates useless-return |
| 111 | +# Pylint 2.4 adds import-outside-toplevel. But we do that a lot to defer imports because of patching. |
| 112 | +# Pylint 2.4 adds self-assigning-variable. But we do *that* to avoid unused-import when we |
| 113 | +# "export" the variable and dont have a __all__. |
| 114 | +# Pylint 2.6+ adds some python-3-only things that dont apply: raise-missing-from, super-with-arguments, consider-using-f-string, redundant-u-string-prefix |
| 115 | +# cyclic import is added because it pylint is spuriously detecting that |
| 116 | +# consider-using-assignment-expr wants you to transform things like: |
| 117 | +# foo = get_foo() |
| 118 | +# if foo: ... |
| 119 | +# |
| 120 | +# Into ``if (foo := get_foo()):`` |
| 121 | +# But there are a *lot* of those. Trust people to do the right, most |
| 122 | +# readable, thing |
| 123 | +# |
| 124 | +# docstring-first-line-empty: That's actually our standard, based on Django. |
| 125 | +# XXX: unclear on the docstring warnings, missing-type-doc, missing-param-doc, |
| 126 | +# differing-param-doc, differing-type-doc (are the last two replacements for the first two?) |
| 127 | +# |
| 128 | +# They should be addressed, in general they are a good thing, but sometimes they are |
| 129 | +# unnecessary. |
| 130 | +disable=wrong-import-position, |
| 131 | + wrong-import-order, |
| 132 | + missing-docstring, |
| 133 | + ungrouped-imports, |
| 134 | + invalid-name, |
| 135 | + too-few-public-methods, |
| 136 | + global-statement, |
| 137 | + locally-disabled, |
| 138 | + too-many-arguments, |
| 139 | + useless-suppression, |
| 140 | + duplicate-code, |
| 141 | + useless-object-inheritance, |
| 142 | + import-outside-toplevel, |
| 143 | + self-assigning-variable, |
| 144 | + consider-using-f-string, |
| 145 | + consider-using-assignment-expr, |
| 146 | + use-dict-literal, |
| 147 | + missing-type-doc, |
| 148 | + missing-param-doc, |
| 149 | + differing-param-doc, |
| 150 | + differing-type-doc, |
| 151 | + compare-to-zero, |
| 152 | + docstring-first-line-empty, |
| 153 | + |
| 154 | +enable=consider-using-augmented-assign |
| 155 | + |
| 156 | +[FORMAT] |
| 157 | +max-line-length=100 |
| 158 | +max-module-lines=1100 |
| 159 | + |
| 160 | +[MISCELLANEOUS] |
| 161 | +# List of note tags to take in consideration, separated by a comma. |
| 162 | +#notes=FIXME,XXX,TODO |
| 163 | +# Disable that, we don't want them to fail the lint CI job. |
| 164 | +notes= |
| 165 | + |
| 166 | +[VARIABLES] |
| 167 | + |
| 168 | +dummy-variables-rgx=_.* |
| 169 | +init-import=true |
| 170 | + |
| 171 | +[TYPECHECK] |
| 172 | + |
| 173 | +# List of members which are set dynamically and missed by pylint inference |
| 174 | +# system, and so shouldnt trigger E1101 when accessed. Python regular |
| 175 | +# expressions are accepted. |
| 176 | +generated-members=REQUEST,acl_users,aq_parent,providedBy |
| 177 | + |
| 178 | + |
| 179 | +# Tells whether missing members accessed in mixin class should be ignored. A |
| 180 | +# mixin class is detected if its name ends with "mixin" (case insensitive). |
| 181 | +# XXX: deprecated in 2.14; replaced with ignored-checks-for-mixins. |
| 182 | +# The defaults for that value seem to be what we want |
| 183 | +#ignore-mixin-members=yes |
| 184 | + |
| 185 | +# List of classes names for which member attributes should not be checked |
| 186 | +# (useful for classes with attributes dynamically set). This can work |
| 187 | +# with qualified names. |
| 188 | +#ignored-classes=SSLContext, SSLSocket, greenlet, Greenlet, parent, dead |
| 189 | + |
| 190 | + |
| 191 | +# List of module names for which member attributes should not be checked |
| 192 | +# (useful for modules/projects where namespaces are manipulated during runtime |
| 193 | +# and thus existing member attributes cannot be deduced by static analysis. It |
| 194 | +# supports qualified module names, as well as Unix pattern matching. |
| 195 | +#ignored-modules=gevent._corecffi,gevent.os,os,greenlet,threading,gevent.libev.corecffi,gevent.socket,gevent.core,gevent.testing.support |
| 196 | +ignored-modules=psycopg2.errors |
| 197 | + |
| 198 | +[DESIGN] |
| 199 | +max-attributes=12 |
| 200 | +max-parents=10 |
| 201 | +# Bump complexity up one. |
| 202 | +max-complexity=11 |
| 203 | + |
| 204 | +[BASIC] |
| 205 | +# Prospector turns ot unsafe-load-any-extension by default, but |
| 206 | +# pylint leaves it off. This is the proximal cause of the |
| 207 | +# undefined-all-variable crash. |
| 208 | +unsafe-load-any-extension = yes |
| 209 | +# This does not seem to work, hence the init-hook |
| 210 | +property-classes=zope.cachedescriptors.property.Lazy,zope.cachedescriptors.property.Cached |
| 211 | + |
| 212 | +[CLASSES] |
| 213 | +# List of interface methods to ignore, separated by a comma. This is used for |
| 214 | +# instance to not check methods defines in Zope's Interface base class. |
| 215 | + |
| 216 | + |
| 217 | + |
| 218 | +# Local Variables: |
| 219 | +# mode: conf |
| 220 | +# End: |
0 commit comments