1
- # ##########################################################################
2
- # https://github.com/exercism/python-analyzer/blob/main/lib/common/.pylintrc
1
+ # This Pylint rcfile contains a best-effort configuration to uphold the
2
+ # best-practices and style described in the Google Python style guide:
3
+ # https://google.github.io/styleguide/pyguide.html
3
4
#
4
- # This common pylintrc file contains a best-effort configuration to uphold the
5
- # best-practices and style for the Python track exercises of exercism.org.
6
- #
7
- # This file is used when there is no exercise-specific pylintrc.
8
- # When there is an exercise-specific pylintrc, this config file is ignored
9
- # in favor of the exercise-specific config.
10
- #
11
- # As a default, all warnings and checks are "turned on", although that may
12
- # change in the future, as we decide which rules to enforce for all exercises.
13
- #
14
- # **A note on single letter variable names.**
15
- # See this Stack Overflow discussion:
16
- # https://stackoverflow.com/questions/21833872/why-does-pylint-object-to-single-character-variable-names
17
- # for why this is enforced.
18
- # ##########################################################################
19
-
5
+ # Its canonical open-source location is:
6
+ # https://google.github.io/styleguide/pylintrc
20
7
21
8
[MASTER]
22
9
@@ -58,63 +45,115 @@ confidence=
58
45
# can either give multiple identifiers separated by comma (,) or put this
59
46
# option multiple times (only on the command line, not in the configuration
60
47
# file where it should appear only once).You can also use "--disable=all" to
61
- # disable everything first and then re-enable specific checks. For example, if
48
+ # disable everything first and then reenable specific checks. For example, if
62
49
# you want to run only the similarities checker, you can use "--disable=all
63
50
# --enable=similarities". If you want to run only the classes checker, but have
64
51
# no Warning level messages displayed, use"--disable=all --enable=classes
65
52
# --disable=W"
66
- # inconsistent-return-statements,
67
- # disable=arguments-differ,
68
- # attribute-defined-outside-init,
69
- # duplicate-code,
70
- # filter-builtin-not-iterating,
71
- # fixme,
72
- # global-statement,
73
- # implicit-str-concat-in-sequence,
74
- # import-error,
75
- # import-self,
76
- # input-builtin,
77
- # locally-disabled,
78
- # misplaced-comparison-constant,
79
- # missing-class-docstring,
80
- # missing-function-docstring,
81
- # missing-module-docstring,
82
- # no-absolute-import,
83
- # no-else-break,
84
- # no-else-continue,
85
- # no-else-raise,
86
- # no-else-return,
87
- # no-member,
88
- # no-name-in-module,
89
- # no-self-use,
90
- # raising-string,
91
- # relative-import,
92
- # round-builtin,
93
- # signature-differs,
94
- # suppressed-message,
95
- # too-few-public-methods,
96
- # too-many-ancestors,
97
- # too-many-arguments,
98
- # too-many-boolean-expressions,
99
- # too-many-branches,
100
- # too-many-instance-attributes,
101
- # too-many-locals,
102
- # too-many-nested-blocks,
103
- # too-many-public-methods,
104
- # too-many-return-statements,
105
- # too-many-statements,
106
- # unused-argument,
107
- # unused-import,
108
- # useless-suppression
109
- disable =trailing-whitespace,missing-final-newline
53
+ disable =abstract-method,
54
+ apply-builtin,
55
+ arguments-differ,
56
+ attribute-defined-outside-init,
57
+ backtick,
58
+ bad-option-value,
59
+ basestring-builtin,
60
+ buffer-builtin,
61
+ c-extension-no-member,
62
+ consider-using-enumerate,
63
+ cmp-builtin,
64
+ cmp-method,
65
+ coerce-builtin,
66
+ coerce-method,
67
+ delslice-method,
68
+ div-method,
69
+ duplicate-code,
70
+ eq-without-hash,
71
+ execfile-builtin,
72
+ file-builtin,
73
+ filter-builtin-not-iterating,
74
+ fixme,
75
+ getslice-method,
76
+ global-statement,
77
+ hex-method,
78
+ idiv-method,
79
+ implicit-str-concat,
80
+ import-error,
81
+ import-self,
82
+ import-star-module-level,
83
+ inconsistent-return-statements,
84
+ input-builtin,
85
+ intern-builtin,
86
+ invalid-str-codec,
87
+ locally-disabled,
88
+ long-builtin,
89
+ long-suffix,
90
+ map-builtin-not-iterating,
91
+ misplaced-comparison-constant,
92
+ missing-function-docstring,
93
+ metaclass-assignment,
94
+ next-method-called,
95
+ next-method-defined,
96
+ no-absolute-import,
97
+ no-else-break,
98
+ no-else-continue,
99
+ no-else-raise,
100
+ no-else-return,
101
+ no-init, # added
102
+ no-member,
103
+ no-name-in-module,
104
+ no-self-use,
105
+ nonzero-method,
106
+ oct-method,
107
+ old-division,
108
+ old-ne-operator,
109
+ old-octal-literal,
110
+ old-raise-syntax,
111
+ parameter-unpacking,
112
+ print-statement,
113
+ raising-string,
114
+ range-builtin-not-iterating,
115
+ raw_input-builtin,
116
+ rdiv-method,
117
+ reduce-builtin,
118
+ relative-import,
119
+ reload-builtin,
120
+ round-builtin,
121
+ setslice-method,
122
+ signature-differs,
123
+ standarderror-builtin,
124
+ suppressed-message,
125
+ sys-max-int,
126
+ too-few-public-methods,
127
+ too-many-ancestors,
128
+ too-many-arguments,
129
+ too-many-boolean-expressions,
130
+ too-many-branches,
131
+ too-many-instance-attributes,
132
+ too-many-locals,
133
+ too-many-nested-blocks,
134
+ too-many-public-methods,
135
+ too-many-return-statements,
136
+ too-many-statements,
137
+ trailing-newlines,
138
+ unichr-builtin,
139
+ unicode-builtin,
140
+ unnecessary-pass,
141
+ unpacking-in-except,
142
+ useless-else-on-loop,
143
+ useless-object-inheritance,
144
+ useless-suppression,
145
+ using-cmp-argument,
146
+ wrong-import-order,
147
+ xrange-builtin,
148
+ zip-builtin-not-iterating,
110
149
111
150
112
151
[REPORTS]
113
152
114
153
# Set the output format. Available formats are text, parseable, colorized, msvs
115
154
# (visual studio) and html. You can also give a reporter class, eg
116
155
# mypackage.mymodule.MyReporterClass.
117
- # output-format=colorized
156
+ output-format =text
118
157
119
158
# Tells whether to display a full report or only the messages
120
159
reports =no
@@ -134,17 +173,17 @@ evaluation=10.0 - ((float(5 * error + warning + refactor + convention) / stateme
134
173
[BASIC]
135
174
136
175
# Good variable names which should always be accepted, separated by a comma
137
- good-names =main,_, item, element, index
176
+ good-names =main,_
138
177
139
178
# Bad variable names which should always be refused, separated by a comma
140
- bad-names =x,y,i,l,L,O,j,m,n,k
179
+ bad-names =
141
180
142
181
# Colon-delimited sets of names that determine each other's naming style when
143
182
# the name regexes allow several styles.
144
183
name-group =
145
184
146
185
# Include a hint for the correct naming format with invalid-name
147
- include-naming-hint =y
186
+ include-naming-hint =no
148
187
149
188
# List of decorators that produce properties, such as abc.abstractproperty. Add
150
189
# to this list to register other decorators that produce valid properties.
@@ -154,7 +193,7 @@ property-classes=abc.abstractproperty,cached_property.cached_property,cached_pro
154
193
function-rgx =^(?:(?P<exempt>setUp|tearDown|setUpModule|tearDownModule)|(?P<camel_case>_?[A-Z][a-zA-Z0-9]*)|(?P<snake_case>_?[a-z][a-z0-9_]*))$
155
194
156
195
# Regular expression matching correct variable names
157
- variable-rgx =^[a-z_ ][a-z0-9_]{1,30} $
196
+ variable-rgx =^[a-z ][a-z0-9_]* $
158
197
159
198
# Regular expression matching correct constant names
160
199
const-rgx =^(_?[A-Z][A-Z0-9_]*|__[a-z0-9_]+__|_?[a-z][a-z0-9_]*)$
@@ -163,7 +202,7 @@ const-rgx=^(_?[A-Z][A-Z0-9_]*|__[a-z0-9_]+__|_?[a-z][a-z0-9_]*)$
163
202
attr-rgx =^_{0,2}[a-z][a-z0-9_]*$
164
203
165
204
# Regular expression matching correct argument names
166
- argument-rgx =^[a-z][a-z0-9_]{1,30} $
205
+ argument-rgx =^[a-z][a-z0-9_]* $
167
206
168
207
# Regular expression matching correct class attribute names
169
208
class-attribute-rgx =^(_?[A-Z][A-Z0-9_]*|__[a-z0-9_]+__|_?[a-z][a-z0-9_]*)$
@@ -234,19 +273,14 @@ ignore-long-lines=(?x)(
234
273
# else.
235
274
single-line-if-stmt =yes
236
275
237
- # List of optional constructs for which whitespace checking is disabled. `dict-
238
- # separator` is used to allow tabulation in dicts, etc.: {1 : 1,\n222: 2}.
239
- # `trailing-comma` allows a space between comma and closing bracket: (a, ).
240
- # `empty-line` allows space-only lines.
241
- # As of Pylint 2.6+, this option has been disabled, so this is commented out.
242
- # no-space-check=
243
-
244
276
# Maximum number of lines in a module
245
277
max-module-lines =99999
246
278
247
- # String used as indentation unit. Currently 4, consistent with
248
- # PEP 8.
249
- indent-string =' '
279
+ # String used as indentation unit. The internal Google style guide mandates 2
280
+ # spaces. Google's externaly-published style guide says 4, consistent with
281
+ # PEP 8. Here, we use 2 spaces, for conformity with many open-sourced Google
282
+ # projects (like TensorFlow).
283
+ indent-string =' '
250
284
251
285
# Number of spaces of indent required inside a hanging or continued line.
252
286
indent-after-paren =4
@@ -283,7 +317,7 @@ additional-builtins=
283
317
284
318
# List of strings which can identify a callback function by name. A callback
285
319
# name must start or end with one of those strings.
286
- callbacks =
320
+ callbacks =cb_,_cb
287
321
288
322
# List of qualified module names which can have objects that can redefine
289
323
# builtins.
@@ -294,7 +328,7 @@ redefining-builtins-modules=six,six.moves,past.builtins,future.builtins,functool
294
328
295
329
# Logging modules to check that the string format arguments are in logging
296
330
# function parameter format
297
- logging-modules =logging,absl.logging
331
+ logging-modules =logging,absl.logging,tensorflow.io.logging
298
332
299
333
300
334
[SIMILARITIES]
@@ -392,4 +426,4 @@ valid-metaclass-classmethod-first-arg=mcs
392
426
# "Exception"
393
427
overgeneral-exceptions =builtins.StandardError,
394
428
builtins.Exception,
395
- builtins.BaseException
429
+ builtins.BaseException
0 commit comments