/
pylintrc
129 lines (105 loc) · 4.39 KB
/
pylintrc
1
2
3
4
5
6
7
8
9
10
11
12
13
14
15
16
17
18
19
20
21
22
23
24
25
26
27
28
29
30
31
32
33
34
35
36
37
38
39
40
41
42
43
44
45
46
47
48
49
50
51
52
53
54
55
56
57
58
59
60
61
62
63
64
65
66
67
68
69
70
71
72
73
74
75
76
77
78
79
80
81
82
83
84
85
86
87
88
89
90
91
92
93
94
95
96
97
98
99
100
101
102
103
104
105
106
107
108
109
110
111
112
113
114
115
116
117
118
119
120
121
122
123
124
125
126
127
128
129
[MAIN]
# import-error (E0401)
# For this to work, we either need to add our dependencies to the pre-commit
# task that runs this, or change to using a system (instead of python) local repo.
# This adds some complexity (e.g. user must install pylint and the required dependencies
# in their current python environment first).
# For now, we just disable this error.
# TODO: At some point, we may enable it, allowing pylintrc to perform more precise analysis
# exec-used (W0122)
# We already check for this with bandit, so no need to double up on comments marking exceptions
# unused-import (W0611)
# We already check for this with flake8, so no need to double up on comments marking exceptions
# unnecessary-pass (W0107)
# unnecessary-ellipsis (W2301)
# Technically, a docstring suffices, but this is a style issue that is not so clear
# logging-not-lazy (W1201)
# logging-format-interpolation (W1202)
# logging-fstring-interpolation (W1203)
# The performance difference is negligible and format strings are more readable
# _fixme (W0511)
# It can be useful to leave these notes in the code
# unused-argument (W0613)
# The arguments to a function (and their name) are part of the API
# of a function. Whether it uses the argument is an implementation detail
# that should not affect the argument names, and adding lots of annotations
# is undesirable
# useless-parent-delegation (W0246): Useless parent or super() delegation in method
# These are not always useless, since we check if methods such as predict are
# explicitly defined in a class
# broad-except (W0703): Catching too general exception
# Unclear, but we may want to mark the ones that we need and turn this on
# attribute-defined-outside-init (W0201)
# TODO: We should fix these and enable this
# protected-access (W0212): Access to a protected member
# TODO: We should fix these and enable this
# abstract-method (W0223):
# This gives a number of false positives, but it might be worth addressing
# line-too-long (C0301)
# Triggers on long descriptions in schemas.
# We use flake8 to enforce a more tolerant version
# useless-import-alias (C0414): Import alias does not rename original package
# We use these aliases deliberately in __init__ files, in order
# to mark them as re-exported, so that pyright treats them as
# public and not private
# import-outside-toplevel (C0415)
# We do this a lot, and often with reason (e.g. circular dependencies)
# invalid-name (C0103): doesn't conform to snake_case naming style
# TODO: This probably should be enabled, with relaxations/exceptions for
# names like 'X' and 'y' and similar derived names
# missing-module-docstring (C0114)
# missing-class-docstring (C0115)
# missing-function-docstring (C0116)
# We may want to enable some of these,
# but note that our wrapper impls generally don't (currently)
# bother with them
# too-many-lines (C0302)
# yes, some of our files are a bit long
# cyclic-import (R0401)
# We have a bunch of these
# duplicate-code (R0801): duplicate code warning
# no-else-return (R1705):
# Not sure if we want to enforce this
# too-many-ancestors (R0901)
# too-many-instance-attributes (R0902)
# too-few-public-methods (R0903)
# too-many-public-methods (R0904)
# too-many-return-statements (R0911)
# too-many-branches (R0912)
# too-many-arguments (R0913)
# too-many-locals (R0914)
# too-many-statements (R0915)
# too-many-boolean-expressions (R0916)
# too-many-nested-blocks (R1702)
# some of our code is complex
disable=
# Errors
import-error,
# Warnings
exec-used,unused-import, # already checked by other tools
unnecessary-pass,unnecessary-ellipsis,
logging-not-lazy,logging-format-interpolation,logging-fstring-interpolation,
fixme,
unused-argument,
useless-parent-delegation,
broad-except,
protected-access,
abstract-method,
attribute-defined-outside-init,
# Conventions
line-too-long,useless-import-alias,
import-outside-toplevel,
invalid-name,
missing-module-docstring,missing-class-docstring,missing-function-docstring,
too-many-lines,
# Refactors
cyclic-import,
duplicate-code,
no-else-return,
too-many-ancestors,too-many-instance-attributes,
too-few-public-methods,too-many-public-methods,
too-many-return-statements,too-many-branches,too-many-arguments,
too-many-locals,too-many-statements,
too-many-boolean-expressions,too-many-nested-blocks
[FORMAT]
good-names=X,y