Jon Hall | e1b478d | 2015-01-12 11:31:56 -0800 | [diff] [blame] | 1 | # lint Python modules using external checkers. |
| 2 | # |
| 3 | # This is the main checker controlling the other ones and the reports |
| 4 | # generation. It is itself both a raw checker and an astng checker in order |
| 5 | # to: |
| 6 | # * handle message activation / deactivation at the module level |
| 7 | # * handle some basic but necessary stats'data (number of classes, methods...) |
| 8 | # |
| 9 | [MASTER] |
| 10 | |
| 11 | # Specify a configuration file. |
| 12 | #rcfile= |
| 13 | |
| 14 | # Python code to execute, usually for sys.path manipulation such as |
| 15 | # pygtk.require(). |
| 16 | #init-hook= |
| 17 | |
| 18 | # Profiled execution. |
| 19 | profile=no |
| 20 | |
| 21 | # Add <file or directory> to the black list. It should be a base name, not a |
| 22 | # path. You may set this option multiple times. |
| 23 | ignore=CVS |
| 24 | |
| 25 | # Pickle collected data for later comparisons. |
| 26 | persistent=yes |
| 27 | |
| 28 | # List of plugins (as comma separated values of python modules names) to load, |
| 29 | # usually to register additional checkers. |
| 30 | load-plugins= |
| 31 | |
| 32 | |
| 33 | [MESSAGES CONTROL] |
| 34 | |
| 35 | # Enable the message, report, category or checker with the given id(s). You can |
| 36 | # either give multiple identifier separated by comma (,) or put this option |
| 37 | # multiple time. |
| 38 | #enable= |
| 39 | |
| 40 | # Disable the message, report, category or checker with the given id(s). You |
| 41 | # can either give multiple identifier separated by comma (,) or put this option |
| 42 | # multiple time (only on the command line, not in the configuration file where |
| 43 | # it should appear only once). |
| 44 | disable=pointless-except, invalid-name, super-init-not-called, fixme, star-args, |
| 45 | too-many-instance-attributes, too-few-public-methods, too-many-arguments, |
| 46 | too-many-locals, too-many-public-methods, duplicate-code, bad-whitespace, |
| 47 | locally-disabled |
| 48 | |
| 49 | [REPORTS] |
| 50 | |
| 51 | # Set the output format. Available formats are text, parseable, colorized, msvs |
| 52 | # (visual studio) and html |
| 53 | output-format=colorized |
| 54 | msg-template='{path}:{line}: [{msg_id}({symbol}), {obj}] {msg}' |
| 55 | |
| 56 | # Include message's id in output |
| 57 | include-ids=yes |
| 58 | |
| 59 | # Put messages in a separate file for each module / package specified on the |
| 60 | # command line instead of printing them on stdout. Reports (if any) will be |
| 61 | # written in a file name "pylint_global.[txt|html]". |
| 62 | files-output=no |
| 63 | |
| 64 | # Tells wether to display a full report or only the messages |
| 65 | reports=no |
| 66 | |
| 67 | # Python expression which should return a note less than 10 (10 is the highes |
| 68 | # note). You have access to the variables errors warning, statement which |
| 69 | # respectivly contain the number of errors / warnings messages and the total |
| 70 | # number of statements analyzed. This is used by the global evaluation repor |
| 71 | # (R0004). |
| 72 | evaluation=10.0 - ((float(5 * error + warning + refactor + convention) / statement) * 10) |
| 73 | |
| 74 | # Add a comment according to your evaluation note. This is used by the global |
| 75 | # evaluation report (R0004). |
| 76 | comment=no |
| 77 | |
| 78 | # Enable the report(s) with the given id(s). |
| 79 | #enable-report= |
| 80 | |
| 81 | # Disable the report(s) with the given id(s). |
| 82 | #disable-report= |
| 83 | |
| 84 | |
| 85 | # checks for : |
| 86 | # * doc strings |
| 87 | # * modules / classes / functions / methods / arguments / variables name |
| 88 | # * number of arguments, local variables, branchs, returns and statements in |
| 89 | # functions, methods |
| 90 | # * required module attributes |
| 91 | # * dangerous default values as arguments |
| 92 | # * redefinition of function / method / class |
| 93 | # * uses of the global statemen |
| 94 | # |
| 95 | [BASIC] |
| 96 | |
| 97 | # Required attributes for module, separated by a comma |
| 98 | required-attributes= |
| 99 | |
| 100 | # Regular expression which should only match functions or classes name which do |
| 101 | # not require a docstring |
| 102 | no-docstring-rgx=__.*__ |
| 103 | |
| 104 | # Regular expression which should only match correct module names |
| 105 | module-rgx=(([a-z_][a-z0-9_]*)|([A-Z][a-zA-Z0-9]+))$ |
| 106 | |
| 107 | # Regular expression which should only match correct module level names |
| 108 | const-rgx=(([A-Z_][A-Z0-9_]*)|(__.*__))$ |
| 109 | |
| 110 | # Regular expression which should only match correct class names |
| 111 | class-rgx=[A-Z_][a-zA-Z0-9]+$ |
| 112 | |
| 113 | # Regular expression which should only match correct function names |
| 114 | function-rgx=[a-z_][a-z0-9_]{2,30}$ |
| 115 | |
| 116 | # Regular expression which should only match correct method names |
| 117 | method-rgx=[a-z_][a-z0-9_]{2,30}$ |
| 118 | |
| 119 | # Regular expression which should only match correct instance attribute names |
| 120 | attr-rgx=[a-z_][a-z0-9_]{2,30}$ |
| 121 | |
| 122 | # Regular expression which should only match correct argument names |
| 123 | argument-rgx=[a-z_][a-z0-9_]{2,30}$ |
| 124 | |
| 125 | # Regular expression which should only match correct variable names |
| 126 | variable-rgx=[a-z_][a-z0-9_]{2,30}$ |
| 127 | |
| 128 | # Regular expression which should only match correct list comprehension / |
| 129 | # generator expression variable names |
| 130 | inlinevar-rgx=[A-Za-z_][A-Za-z0-9_]*$ |
| 131 | |
| 132 | # Good variable names which should always be accepted, separated by a comma |
| 133 | good-names=i,j,k,ex,Run,_ |
| 134 | |
| 135 | # Bad variable names which should always be refused, separated by a comma |
| 136 | bad-names=foo,bar,baz,toto,tutu,tata |
| 137 | |
| 138 | # List of builtins function names that should not be used, separated by a comma |
| 139 | bad-functions=map,filter,apply,inpu |
| 140 | |
| 141 | |
| 142 | # try to find bugs in the code using type inference |
| 143 | # |
| 144 | [TYPECHECK] |
| 145 | |
| 146 | # Tells wether missing members accessed in mixin class should be ignored. A |
| 147 | # mixin class is detected if its name ends with "mixin" (case insensitive). |
| 148 | ignore-mixin-members=yes |
| 149 | |
| 150 | # List of classes names for which member attributes should not be checked |
| 151 | # (useful for classes with attributes dynamicaly set). |
| 152 | ignored-classes=SQLObjec |
| 153 | |
| 154 | # When zope mode is activated, add a predefined set of Zope acquired attributes |
| 155 | # to generated-members. |
| 156 | zope=no |
| 157 | |
| 158 | # List of members which are set dynamically and missed by pylint inference |
| 159 | # system, and so shouldn't trigger E0201 when accessed. |
| 160 | generated-members=REQUEST,acl_users,aq_paren |
| 161 | |
| 162 | |
| 163 | # checks for |
| 164 | # * unused variables / imports |
| 165 | # * undefined variables |
| 166 | # * redefinition of variable from builtins or from an outer scope |
| 167 | # * use of variable before assigmen |
| 168 | # |
| 169 | [VARIABLES] |
| 170 | |
| 171 | # Tells wether we should check for unused import in __init__ files. |
| 172 | init-import=no |
| 173 | |
| 174 | # A regular expression matching names used for dummy variables (i.e. not used). |
| 175 | dummy-variables-rgx=_|dummy |
| 176 | |
| 177 | # List of additional names supposed to be defined in builtins. Remember tha |
| 178 | # you should avoid to define new builtins when possible. |
| 179 | additional-builtins= |
| 180 | |
| 181 | |
| 182 | # checks for : |
| 183 | # * methods without self as first argumen |
| 184 | # * overridden methods signature |
| 185 | # * access only to existant members via self |
| 186 | # * attributes not defined in the __init__ method |
| 187 | # * supported interfaces implementation |
| 188 | # * unreachable code |
| 189 | # |
| 190 | [CLASSES] |
| 191 | |
| 192 | # List of interface methods to ignore, separated by a comma. This is used for |
| 193 | # instance to not check methods defines in Zope's Interface base class. |
| 194 | ignore-iface-methods=isImplementedBy,deferred,extends,names,namesAndDescriptions,queryDescriptionFor,getBases,getDescriptionFor,getDoc,getName,getTaggedValue,getTaggedValueTags,isEqualOrExtendedBy,setTaggedValue,isImplementedByInstancesOf,adaptWith,is_implemented_by |
| 195 | |
| 196 | # List of method names used to declare (i.e. assign) instance attributes. |
| 197 | defining-attr-methods=__init__,__new__,setUp,build |
| 198 | |
| 199 | |
| 200 | # checks for sign of poor/misdesign: |
| 201 | # * number of methods, attributes, local variables... |
| 202 | # * size, complexity of functions, methods |
| 203 | # |
| 204 | [DESIGN] |
| 205 | |
| 206 | # Maximum number of arguments for function / method |
| 207 | max-args=5 |
| 208 | |
| 209 | # Maximum number of locals for function / method body |
| 210 | max-locals=15 |
| 211 | |
| 212 | # Maximum number of return / yield for function / method body |
| 213 | max-returns=6 |
| 214 | |
| 215 | # Maximum number of branch for function / method body |
| 216 | max-branchs=12 |
| 217 | |
| 218 | # Maximum number of statements in function / method body |
| 219 | max-statements=50 |
| 220 | |
| 221 | # Maximum number of parents for a class (see R0901). |
| 222 | max-parents=7 |
| 223 | |
| 224 | # Maximum number of attributes for a class (see R0902). |
| 225 | max-attributes=7 |
| 226 | |
| 227 | # Minimum number of public methods for a class (see R0903). |
| 228 | min-public-methods=2 |
| 229 | |
| 230 | # Maximum number of public methods for a class (see R0904). |
| 231 | max-public-methods=20 |
| 232 | |
| 233 | |
| 234 | # checks for |
| 235 | # * external modules dependencies |
| 236 | # * relative / wildcard imports |
| 237 | # * cyclic imports |
| 238 | # * uses of deprecated modules |
| 239 | # |
| 240 | [IMPORTS] |
| 241 | |
| 242 | # Deprecated modules which should not be used, separated by a comma |
| 243 | deprecated-modules=regsub,string,TERMIOS,Bastion,rexec |
| 244 | |
| 245 | # Create a graph of every (i.e. internal and external) dependencies in the |
| 246 | # given file (report R0402 must not be disabled) |
| 247 | import-graph= |
| 248 | |
| 249 | # Create a graph of external dependencies in the given file (report R0402 mus |
| 250 | # not be disabled) |
| 251 | ext-import-graph= |
| 252 | |
| 253 | # Create a graph of internal dependencies in the given file (report R0402 mus |
| 254 | # not be disabled) |
| 255 | int-import-graph= |
| 256 | |
| 257 | |
| 258 | # checks for : |
| 259 | # * unauthorized constructions |
| 260 | # * strict indentation |
| 261 | # * line length |
| 262 | # * use of <> instead of != |
| 263 | # |
| 264 | [FORMAT] |
| 265 | |
| 266 | # Maximum number of characters on a single line. |
| 267 | max-line-length=80 |
| 268 | |
| 269 | # Maximum number of lines in a module |
| 270 | max-module-lines=1500 |
| 271 | |
| 272 | # String used as indentation unit. This is usually " " (4 spaces) or "\t" (1 |
| 273 | # tab). |
| 274 | indent-string=' ' |
| 275 | |
| 276 | |
| 277 | # checks for: |
| 278 | # * warning notes in the code like FIXME, XXX |
| 279 | # * PEP 263: source code with non ascii character but no encoding declaration |
| 280 | # |
| 281 | [MISCELLANEOUS] |
| 282 | |
| 283 | # List of note tags to take in consideration, separated by a comma. |
| 284 | notes=FIXME,XXX,TODO |
| 285 | |
| 286 | |
| 287 | # checks for similarities and duplicated code. This computation may be |
| 288 | # memory / CPU intensive, so you should disable it if you experiments some |
| 289 | # problems. |
| 290 | # |
| 291 | [SIMILARITIES] |
| 292 | |
| 293 | # Minimum lines number of a similarity. |
| 294 | min-similarity-lines=4 |
| 295 | |
| 296 | # Ignore comments when computing similarities. |
| 297 | ignore-comments=yes |
| 298 | |
| 299 | # Ignore docstrings when computing similarities. |
| 300 | ignore-docstrings=yes |