Skip to content

Commit d99851a

Browse files
committed
Revert "Revert "Add a pylintrc to make it easier to use linter (jax-ml#1442)""
This reverts commit 54807b4.
1 parent 54807b4 commit d99851a

File tree

2 files changed

+47
-3
lines changed

2 files changed

+47
-3
lines changed

jax/numpy/lax_numpy.py

+1-3
Original file line numberDiff line numberDiff line change
@@ -103,13 +103,11 @@ def __instancecheck__(self, instance):
103103
except AttributeError:
104104
return isinstance(instance, _arraylike_types)
105105

106-
# pylint: disable=invalid-name
107106
class ndarray(six.with_metaclass(_ArrayMeta, onp.ndarray)):
108107
def __init__(shape, dtype=None, buffer=None, offset=0, strides=None,
109108
order=None):
110109
raise TypeError("jax.numpy.ndarray() should not be instantiated explicitly."
111110
" Use jax.numpy.array, or jax.numpy.zeros instead.")
112-
# pylint: enable=invalid-name
113111

114112

115113
isscalar = onp.isscalar
@@ -3142,4 +3140,4 @@ def _unstack(x):
31423140
if x.ndim == 0:
31433141
raise ValueError("Argument to _unstack must be non-scalar")
31443142
return [lax.index_in_dim(x, i, keepdims=False) for i in range(x.shape[0])]
3145-
setattr(DeviceArray, "_unstack", _unstack)
3143+
setattr(DeviceArray, "_unstack", _unstack)

pylintrc

+46
Original file line numberDiff line numberDiff line change
@@ -0,0 +1,46 @@
1+
[MASTER]
2+
3+
# A comma-separated list of package or module names from where C extensions may
4+
# be loaded. Extensions are loading into the active Python interpreter and may
5+
# run arbitrary code
6+
extension-pkg-whitelist=numpy
7+
8+
9+
[MESSAGES CONTROL]
10+
11+
# Disable the message, report, category or checker with the given id(s). You
12+
# can either give multiple identifiers separated by comma (,) or put this
13+
# option multiple times (only on the command line, not in the configuration
14+
# file where it should appear only once).You can also use "--disable=all" to
15+
# disable everything first and then reenable specific checks. For example, if
16+
# you want to run only the similarities checker, you can use "--disable=all
17+
# --enable=similarities". If you want to run only the classes checker, but have
18+
# no Warning level messages displayed, use"--disable=all --enable=classes
19+
# --disable=W"
20+
disable=missing-docstring,
21+
too-many-locals,
22+
invalid-name,
23+
redefined-outer-name,
24+
redefined-builtin,
25+
protected-name,
26+
no-else-return,
27+
fixme,
28+
protected-access,
29+
too-many-arguments,
30+
blacklisted-name,
31+
too-few-public-methods,
32+
unnecessary-lambda,
33+
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 (only on the command line, not in the configuration file where
38+
# it should appear only once). See also the "--disable" option for examples.
39+
enable=c-extension-no-member
40+
41+
42+
[FORMAT]
43+
44+
# String used as indentation unit. This is usually " " (4 spaces) or "\t" (1
45+
# tab).
46+
indent-string=" "

0 commit comments

Comments
 (0)