Skip to content

Commit e509ec3

Browse files
authored
Merge pull request #27 from tekktrik/dev/update-pylint
Update pylint version
2 parents 1ccf062 + f315b1d commit e509ec3

File tree

9 files changed

+6
-66
lines changed

9 files changed

+6
-66
lines changed

.pre-commit-config.yaml

Lines changed: 1 addition & 1 deletion
Original file line numberDiff line numberDiff line change
@@ -18,7 +18,7 @@ repos:
1818
- id: end-of-file-fixer
1919
- id: trailing-whitespace
2020
- repo: https://github.com/pycqa/pylint
21-
rev: v2.11.1
21+
rev: v2.15.5
2222
hooks:
2323
- id: pylint
2424
name: pylint (library code)

.pylintrc

Lines changed: 3 additions & 40 deletions
Original file line numberDiff line numberDiff line change
@@ -26,7 +26,7 @@ jobs=1
2626

2727
# List of plugins (as comma separated values of python modules names) to load,
2828
# usually to register additional checkers.
29-
load-plugins=
29+
load-plugins=pylint.extensions.no_self_use
3030

3131
# Pickle collected data for later comparisons.
3232
persistent=yes
@@ -54,8 +54,8 @@ confidence=
5454
# --enable=similarities". If you want to run only the classes checker, but have
5555
# no Warning level messages displayed, use"--disable=all --enable=classes
5656
# --disable=W"
57-
# disable=import-error,print-statement,parameter-unpacking,unpacking-in-except,old-raise-syntax,backtick,long-suffix,old-ne-operator,old-octal-literal,import-star-module-level,raw-checker-failed,bad-inline-option,locally-disabled,locally-enabled,file-ignored,suppressed-message,useless-suppression,deprecated-pragma,apply-builtin,basestring-builtin,buffer-builtin,cmp-builtin,coerce-builtin,execfile-builtin,file-builtin,long-builtin,raw_input-builtin,reduce-builtin,standarderror-builtin,unicode-builtin,xrange-builtin,coerce-method,delslice-method,getslice-method,setslice-method,no-absolute-import,old-division,dict-iter-method,dict-view-method,next-method-called,metaclass-assignment,indexing-exception,raising-string,reload-builtin,oct-method,hex-method,nonzero-method,cmp-method,input-builtin,round-builtin,intern-builtin,unichr-builtin,map-builtin-not-iterating,zip-builtin-not-iterating,range-builtin-not-iterating,filter-builtin-not-iterating,using-cmp-argument,eq-without-hash,div-method,idiv-method,rdiv-method,exception-message-attribute,invalid-str-codec,sys-max-int,bad-python3-import,deprecated-string-function,deprecated-str-translate-call
58-
disable=print-statement,parameter-unpacking,unpacking-in-except,old-raise-syntax,backtick,long-suffix,old-ne-operator,old-octal-literal,import-star-module-level,raw-checker-failed,bad-inline-option,locally-disabled,locally-enabled,file-ignored,suppressed-message,useless-suppression,deprecated-pragma,apply-builtin,basestring-builtin,buffer-builtin,cmp-builtin,coerce-builtin,execfile-builtin,file-builtin,long-builtin,raw_input-builtin,reduce-builtin,standarderror-builtin,unicode-builtin,xrange-builtin,coerce-method,delslice-method,getslice-method,setslice-method,no-absolute-import,old-division,dict-iter-method,dict-view-method,next-method-called,metaclass-assignment,indexing-exception,raising-string,reload-builtin,oct-method,hex-method,nonzero-method,cmp-method,input-builtin,round-builtin,intern-builtin,unichr-builtin,map-builtin-not-iterating,zip-builtin-not-iterating,range-builtin-not-iterating,filter-builtin-not-iterating,using-cmp-argument,eq-without-hash,div-method,idiv-method,rdiv-method,exception-message-attribute,invalid-str-codec,sys-max-int,bad-python3-import,deprecated-string-function,deprecated-str-translate-call,import-error,bad-continuation,pointless-string-statement,unused-argument,no-self-use
57+
# disable=import-error,raw-checker-failed,bad-inline-option,locally-disabled,file-ignored,suppressed-message,useless-suppression,deprecated-pragma,deprecated-str-translate-call
58+
disable=raw-checker-failed,bad-inline-option,locally-disabled,file-ignored,suppressed-message,useless-suppression,deprecated-pragma,import-error,pointless-string-statement,unspecified-encoding
5959

6060
# Enable the message, report, category or checker with the given id(s). You can
6161
# either give multiple identifier separated by comma (,) or put this option
@@ -225,12 +225,6 @@ max-line-length=100
225225
# Maximum number of lines in a module
226226
max-module-lines=1000
227227

228-
# List of optional constructs for which whitespace checking is disabled. `dict-
229-
# separator` is used to allow tabulation in dicts, etc.: {1 : 1,\n222: 2}.
230-
# `trailing-comma` allows a space between comma and closing bracket: (a, ).
231-
# `empty-line` allows space-only lines.
232-
no-space-check=trailing-comma,dict-separator
233-
234228
# Allow the body of a class to be on the same line as the declaration if body
235229
# contains single statement.
236230
single-line-class-stmt=no
@@ -257,48 +251,29 @@ min-similarity-lines=12
257251

258252
[BASIC]
259253

260-
# Naming hint for argument names
261-
argument-name-hint=(([a-z][a-z0-9_]{2,30})|(_[a-z0-9_]*))$
262-
263254
# Regular expression matching correct argument names
264255
argument-rgx=(([a-z][a-z0-9_]{2,30})|(_[a-z0-9_]*))$
265256

266-
# Naming hint for attribute names
267-
attr-name-hint=(([a-z][a-z0-9_]{2,30})|(_[a-z0-9_]*))$
268-
269257
# Regular expression matching correct attribute names
270258
attr-rgx=(([a-z][a-z0-9_]{2,30})|(_[a-z0-9_]*))$
271259

272260
# Bad variable names which should always be refused, separated by a comma
273261
bad-names=foo,bar,baz,toto,tutu,tata
274262

275-
# Naming hint for class attribute names
276-
class-attribute-name-hint=([A-Za-z_][A-Za-z0-9_]{2,30}|(__.*__))$
277-
278263
# Regular expression matching correct class attribute names
279264
class-attribute-rgx=([A-Za-z_][A-Za-z0-9_]{2,30}|(__.*__))$
280265

281-
# Naming hint for class names
282-
# class-name-hint=[A-Z_][a-zA-Z0-9]+$
283-
class-name-hint=[A-Z_][a-zA-Z0-9_]+$
284-
285266
# Regular expression matching correct class names
286267
# class-rgx=[A-Z_][a-zA-Z0-9]+$
287268
class-rgx=[A-Z_][a-zA-Z0-9_]+$
288269

289-
# Naming hint for constant names
290-
const-name-hint=(([A-Z_][A-Z0-9_]*)|(__.*__))$
291-
292270
# Regular expression matching correct constant names
293271
const-rgx=(([A-Z_][A-Z0-9_]*)|(__.*__))$
294272

295273
# Minimum line length for functions/classes that require docstrings, shorter
296274
# ones are exempt.
297275
docstring-min-length=-1
298276

299-
# Naming hint for function names
300-
function-name-hint=(([a-z][a-z0-9_]{2,30})|(_[a-z0-9_]*))$
301-
302277
# Regular expression matching correct function names
303278
function-rgx=(([a-z][a-z0-9_]{2,30})|(_[a-z0-9_]*))$
304279

@@ -309,21 +284,12 @@ good-names=r,g,b,w,i,j,k,n,x,y,z,ex,ok,Run,_
309284
# Include a hint for the correct naming format with invalid-name
310285
include-naming-hint=no
311286

312-
# Naming hint for inline iteration names
313-
inlinevar-name-hint=[A-Za-z_][A-Za-z0-9_]*$
314-
315287
# Regular expression matching correct inline iteration names
316288
inlinevar-rgx=[A-Za-z_][A-Za-z0-9_]*$
317289

318-
# Naming hint for method names
319-
method-name-hint=(([a-z][a-z0-9_]{2,30})|(_[a-z0-9_]*))$
320-
321290
# Regular expression matching correct method names
322291
method-rgx=(([a-z][a-z0-9_]{2,30})|(_[a-z0-9_]*))$
323292

324-
# Naming hint for module names
325-
module-name-hint=(([a-z_][a-z0-9_]*)|([A-Z][a-zA-Z0-9]+))$
326-
327293
# Regular expression matching correct module names
328294
module-rgx=(([a-z_][a-z0-9_]*)|([A-Z][a-zA-Z0-9]+))$
329295

@@ -339,9 +305,6 @@ no-docstring-rgx=^_
339305
# to this list to register other decorators that produce valid properties.
340306
property-classes=abc.abstractproperty
341307

342-
# Naming hint for variable names
343-
variable-name-hint=(([a-z][a-z0-9_]{2,30})|(_[a-z0-9_]*))$
344-
345308
# Regular expression matching correct variable names
346309
variable-rgx=(([a-z][a-z0-9_]{2,30})|(_[a-z0-9_]*))$
347310

circuitpython_typing/__init__.py

Lines changed: 0 additions & 2 deletions
Original file line numberDiff line numberDiff line change
@@ -66,12 +66,10 @@ def read(self, count: Optional[int] = None) -> Optional[bytes]:
6666
or if the parameter is not specified in the call,
6767
the outcome is implementation-dependent.
6868
"""
69-
...
7069

7170
# Should be `, /)`, but not available in Python 3.7.
7271
def write(self, buf: ReadableBuffer) -> Optional[int]:
7372
"""Write the bytes in ``buf`` to the stream."""
74-
...
7573

7674

7775
# These types may not be in adafruit-blinka, so use the string form instead of a resolved name.

circuitpython_typing/http.py

Lines changed: 0 additions & 5 deletions
Original file line numberDiff line numberDiff line change
@@ -21,20 +21,15 @@ class HTTPProtocol(Protocol):
2121

2222
def get(self, url: str, **kw) -> Response:
2323
"""Send HTTP GET request"""
24-
...
2524

2625
def put(self, url: str, **kw) -> Response:
2726
"""Send HTTP PUT request"""
28-
...
2927

3028
def post(self, url: str, **kw) -> Response:
3129
"""Send HTTP POST request"""
32-
...
3330

3431
def patch(self, url: str, **kw) -> Response:
3532
"""Send HTTP PATCH request"""
36-
...
3733

3834
def delete(self, url: str, **kw) -> Response:
3935
"""Send HTTP DELETE request"""
40-
...

circuitpython_typing/io.py

Lines changed: 1 addition & 0 deletions
Original file line numberDiff line numberDiff line change
@@ -38,6 +38,7 @@ def value(self) -> float:
3838
on the specifics of the class.
3939
"""
4040

41+
# pylint: disable=no-self-use,unused-argument
4142
@value.setter
4243
def value(self, input_value: float, /):
4344
...

circuitpython_typing/led.py

Lines changed: 0 additions & 2 deletions
Original file line numberDiff line numberDiff line change
@@ -24,12 +24,10 @@ class ColorBasedLED(Protocol):
2424

2525
def color(self, value: ColorBasedColorUnion) -> None:
2626
"""Sets the color of the LED"""
27-
...
2827

2928

3029
class FillBasedLED(Protocol):
3130
"""Protocol for LEDs using the :meth:`fill` method"""
3231

3332
def fill(self, color: FillBasedColorUnion) -> None:
3433
"""Sets the color of the LED"""
35-
...

circuitpython_typing/pil.py

Lines changed: 0 additions & 4 deletions
Original file line numberDiff line numberDiff line change
@@ -21,7 +21,6 @@ class PixelAccess(Protocol):
2121
# pylint: disable=invalid-name
2222
def __getitem__(self, xy: Tuple[int, int]) -> int:
2323
"""Get pixels by x, y coordinate"""
24-
...
2524

2625

2726
class Image(Protocol):
@@ -30,13 +29,10 @@ class Image(Protocol):
3029
@property
3130
def mode(self) -> str:
3231
"""The mode of the image"""
33-
...
3432

3533
@property
3634
def size(self) -> Tuple[int, int]:
3735
"""The size of the image"""
38-
...
3936

4037
def load(self) -> PixelAccess:
4138
"""Load the image for quick pixel access"""
42-
...

circuitpython_typing/pwmio.py

Lines changed: 1 addition & 1 deletion
Original file line numberDiff line numberDiff line change
@@ -21,8 +21,8 @@ class PWMOut(Protocol):
2121
@property
2222
def duty_cycle(self) -> int:
2323
"""The duty cycle as a ratio using 16-bits"""
24-
...
2524

25+
# pylint: disable=no-self-use,unused-argument
2626
@duty_cycle.setter
2727
def duty_cycle(self, duty_cycle: int) -> None:
2828
...

circuitpython_typing/socket.py

Lines changed: 0 additions & 11 deletions
Original file line numberDiff line numberDiff line change
@@ -41,15 +41,12 @@ class CommonSocketType(Protocol):
4141
def send(self, data: bytes, flags: int = ...) -> None:
4242
"""Send data to the socket. The meaning of the optional flags kwarg is
4343
implementation-specific."""
44-
...
4544

4645
def settimeout(self, value: Optional[float]) -> None:
4746
"""Set a timeout on blocking socket operations."""
48-
...
4947

5048
def close(self) -> None:
5149
"""Close the socket."""
52-
...
5350

5451

5552
class CommonCircuitPythonSocketType(CommonSocketType, Protocol):
@@ -62,7 +59,6 @@ def connect(
6259
) -> None:
6360
"""Connect to a remote socket at the provided (host, port) address. The conntype
6461
kwarg optionally may indicate SSL or not, depending on the underlying interface."""
65-
...
6662

6763

6864
class LegacyCircuitPythonSocketType(CommonCircuitPythonSocketType, Protocol):
@@ -72,7 +68,6 @@ def recv(self, bufsize: int = ...) -> bytes:
7268
"""Receive data from the socket. The return value is a bytes object representing
7369
the data received. The maximum amount of data to be received at once is specified
7470
by bufsize."""
75-
...
7671

7772

7873
class SupportsRecvWithFlags(Protocol):
@@ -82,7 +77,6 @@ def recv(self, bufsize: int = ..., flags: int = ...) -> bytes:
8277
"""Receive data from the socket. The return value is a bytes object representing
8378
the data received. The maximum amount of data to be received at once is specified
8479
by bufsize. The meaning of the optional flags kwarg is implementation-specific."""
85-
...
8680

8781

8882
class SupportsRecvInto(Protocol):
@@ -93,7 +87,6 @@ def recv_into(self, buffer: bytearray, nbytes: int = ..., flags: int = ...) -> i
9387
buffer. If nbytes is not specified (or 0), receive up to the size available in the
9488
given buffer. The meaning of the optional flags kwarg is implementation-specific.
9589
Returns the number of bytes received."""
96-
...
9790

9891

9992
class CircuitPythonSocketType(
@@ -104,8 +97,6 @@ class CircuitPythonSocketType(
10497
): # pylint: disable=too-many-ancestors
10598
"""Describes the structure every modern CircuitPython socket type must have."""
10699

107-
...
108-
109100

110101
class StandardPythonSocketType(
111102
CommonSocketType, SupportsRecvInto, SupportsRecvWithFlags, Protocol
@@ -114,7 +105,6 @@ class StandardPythonSocketType(
114105

115106
def connect(self, address: Union[Tuple[Any, ...], str, bytes]) -> None:
116107
"""Connect to a remote socket at the provided address."""
117-
...
118108

119109

120110
SocketType: TypeAlias = Union[
@@ -132,7 +122,6 @@ class InterfaceType(Protocol):
132122
@property
133123
def TLS_MODE(self) -> int: # pylint: disable=invalid-name
134124
"""Constant representing that a socket's connection mode is TLS."""
135-
...
136125

137126

138127
SSLContextType: TypeAlias = Union[SSLContext, "_FakeSSLContext"]

0 commit comments

Comments
 (0)