| 1 | # First cut at a pylintrc to match snakeoil's (and pkgcore's) coding style. |
|---|
| 2 | # |
|---|
| 3 | # Use like "pylint --rcfile=lintplugin/pylintrc snakeoil". |
|---|
| 4 | # |
|---|
| 5 | # This version was written by marienz, which means it is probably not |
|---|
| 6 | # accurate. |
|---|
| 7 | |
|---|
| 8 | |
|---|
| 9 | [master] |
|---|
| 10 | |
|---|
| 11 | # Ignore external modules. |
|---|
| 12 | ignore=demandload.py,bundled_elementtree.py,native_readdir.py |
|---|
| 13 | load-plugins=snakeoil_lint |
|---|
| 14 | |
|---|
| 15 | |
|---|
| 16 | [REPORTS] |
|---|
| 17 | |
|---|
| 18 | # Disable a bunch of silly checkers. |
|---|
| 19 | # |
|---|
| 20 | # To add to this list run pylint with --include-ids=y so you can see |
|---|
| 21 | # what id the message you want to disable has. To disable a message |
|---|
| 22 | # temporarily pass --disable-msg=id1,id2 (useful for things like |
|---|
| 23 | # docstrings (C0111)). |
|---|
| 24 | |
|---|
| 25 | # * or ** magic: W0142 |
|---|
| 26 | # unused argument: W0613 |
|---|
| 27 | # too many ancestors: R0901 |
|---|
| 28 | # not enough pub methods: R0903 |
|---|
| 29 | # too many pub methods: R0904 |
|---|
| 30 | # method could be a function: R0201 |
|---|
| 31 | # mention what is locally disabled (I0011) |
|---|
| 32 | # abstract method not overridden: W0223 |
|---|
| 33 | # Metaclass should have "mcs" as first argument (we use "cls", string |
|---|
| 34 | # is hardcoded): C0203 |
|---|
| 35 | # Except doesn't do anything (just "pass" in an except clause): W0704 |
|---|
| 36 | # Missing docstring: C0111 |
|---|
| 37 | # Too many return statements: R0911 |
|---|
| 38 | # Too many branches: R0912 |
|---|
| 39 | # Too many local variables: R0914 |
|---|
| 40 | # Too many statements: R0915 |
|---|
| 41 | # Abstract class not referenced: R0921 |
|---|
| 42 | # Abstract class only referenced n times: R0922 |
|---|
| 43 | # Line too long: C0301 |
|---|
| 44 | # Invalid name: C0303 |
|---|
| 45 | disable-msg=W0142,W0613,R0901,R0903,R0904,R0201,I0011,W0223,C0203,W0704,C0111,R0911,R0912,R0914,R0915,R0921,R0922,C0301,W0621,W0622,C0103 |
|---|
| 46 | |
|---|
| 47 | [MESSAGES CONTROL] |
|---|
| 48 | # Newer pylints use this one. Keep both locations in sync for now. |
|---|
| 49 | disable-msg=W0142,W0613,R0901,R0903,R0904,R0201,I0011,W0223,C0203,W0704,C0111,R0911,R0912,R0914,R0915,R0921,R0922,C0301,W0621,W0622,C0103 |
|---|
| 50 | |
|---|
| 51 | [BASIC] |
|---|
| 52 | |
|---|
| 53 | # Required attributes for module, separated by a comma. Was __revision__. |
|---|
| 54 | required-attributes= |
|---|
| 55 | |
|---|
| 56 | # Regular expression which should only match functions or classes name which do |
|---|
| 57 | # not require a docstring. Was __.*__ |
|---|
| 58 | no-docstring-rgx=^_ |
|---|
| 59 | |
|---|
| 60 | # Regular expression which should only match correct module level names |
|---|
| 61 | # was: (([A-Z_][A-Z1-9_]*)|(__.*__))$ |
|---|
| 62 | const-rgx=(([A-Z_][A-Z1-9_]*)|([a-z_][a-z1-9_]*))$ |
|---|
| 63 | |
|---|
| 64 | # Regular expression which should only match correct class names |
|---|
| 65 | # TODO make this stricter |
|---|
| 66 | # was: [A-Z_][a-zA-Z0-9]+$ |
|---|
| 67 | class-rgx=([A-Z_][a-zA-Z0-9]+|[a-z_][a-z0-9_]+)$ |
|---|
| 68 | |
|---|
| 69 | # Regular expression which should only match correct instance attribute names |
|---|
| 70 | # Was: [a-z_][a-z0-9_]{2,30}$ |
|---|
| 71 | attr-rgx=[a-z_][a-z0-9_]{1,30}$ |
|---|
| 72 | |
|---|
| 73 | # Regular expression which should only match correct argument names |
|---|
| 74 | # Was: [a-z_][a-z0-9_]{2,30}$ |
|---|
| 75 | argument-rgx=([a-z_][a-z0-9_]{2,30}|a|kw)$ |
|---|
| 76 | |
|---|
| 77 | # Regular expression which should only match correct variable names |
|---|
| 78 | # Was: [a-z_][a-z0-9_]{2,30}$ |
|---|
| 79 | variable-rgx=[a-z_][a-z0-9_]{0,30}$ |
|---|
| 80 | |
|---|
| 81 | # Good variable names which should always be accepted, separated by a comma |
|---|
| 82 | # Was: d,e,i,j,ex,_ |
|---|
| 83 | good-names=d,e,i,j,ex,_,setUp,tearDown,force_True,force_False,f |
|---|
| 84 | |
|---|
| 85 | # "bad" builtins. |
|---|
| 86 | # Was: map,filter,apply,input |
|---|
| 87 | bad-functions=filter,apply,input |
|---|
| 88 | |
|---|
| 89 | [VARIABLES] |
|---|
| 90 | |
|---|
| 91 | # A regular expression matching names used for dummy variables (i.e. not used) |
|---|
| 92 | # (common use case is unused loop counter variable). |
|---|
| 93 | # Was: _|dummy |
|---|
| 94 | dummy-variables-rgx=_|dummy|i |
|---|
| 95 | |
|---|
| 96 | |
|---|
| 97 | [DESIGN] |
|---|
| 98 | |
|---|
| 99 | # Maximum number of arguments for function / method |
|---|
| 100 | # Was: 6 |
|---|
| 101 | max-args=12 |
|---|