Skip to content

Commit 633203a

Browse files
authored
Merge pull request #314 from makermelissa/update-versions
Update Pre-commit config versions
2 parents 8cc24b0 + e4ca06b commit 633203a

File tree

7 files changed

+23
-60
lines changed

7 files changed

+23
-60
lines changed

.pre-commit-config.yaml

Lines changed: 4 additions & 5 deletions
Original file line numberDiff line numberDiff line change
@@ -4,22 +4,21 @@
44

55
repos:
66
- repo: https://github.com/python/black
7-
rev: 22.3.0
7+
rev: 23.3.0
88
hooks:
99
- id: black
10-
additional_dependencies: ['click==8.0.4']
1110
- repo: https://github.com/fsfe/reuse-tool
12-
rev: v0.12.1
11+
rev: v1.1.2
1312
hooks:
1413
- id: reuse
1514
- repo: https://github.com/pre-commit/pre-commit-hooks
16-
rev: v2.3.0
15+
rev: v4.4.0
1716
hooks:
1817
- id: check-yaml
1918
- id: end-of-file-fixer
2019
- id: trailing-whitespace
2120
- repo: https://github.com/pycqa/pylint
22-
rev: v2.11.1
21+
rev: v2.17.4
2322
hooks:
2423
- id: pylint
2524
name: pylint (library code)

.pylintrc

Lines changed: 8 additions & 47 deletions
Original file line numberDiff line numberDiff line change
@@ -9,11 +9,11 @@
99
# run arbitrary code
1010
extension-pkg-whitelist=hid
1111

12-
# Add files or directories to the blacklist. They should be base names, not
12+
# Add files or directories to the ignore-list. They should be base names, not
1313
# paths.
1414
ignore=CVS
1515

16-
# Add files or directories matching the regex patterns to the blacklist. The
16+
# Add files or directories matching the regex patterns to the ignore-list. The
1717
# regex matches against base names, not paths.
1818
ignore-patterns=
1919

@@ -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,attribute-defined-outside-init,bad-continuation,invalid-name,import-error,import-outside-toplevel,too-many-branches,too-many-statements,too-many-public-methods
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,import-outside-toplevel,too-many-branches,too-many-statements,too-many-public-methods
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
@@ -223,15 +223,7 @@ indent-string=' '
223223
max-line-length=100
224224

225225
# Maximum number of lines in a module
226-
#
227-
# XXX: Reduce this number once Issue 296 is resolved.
228-
max-module-lines=1050
229-
230-
# List of optional constructs for which whitespace checking is disabled. `dict-
231-
# separator` is used to allow tabulation in dicts, etc.: {1 : 1,\n222: 2}.
232-
# `trailing-comma` allows a space between comma and closing bracket: (a, ).
233-
# `empty-line` allows space-only lines.
234-
no-space-check=trailing-comma,dict-separator
226+
max-module-lines=1000
235227

236228
# Allow the body of a class to be on the same line as the declaration if body
237229
# contains single statement.
@@ -251,56 +243,37 @@ ignore-comments=yes
251243
ignore-docstrings=yes
252244

253245
# Ignore imports when computing similarities.
254-
ignore-imports=no
246+
ignore-imports=yes
255247

256248
# Minimum lines number of a similarity.
257249
min-similarity-lines=12
258250

259251

260252
[BASIC]
261253

262-
# Naming hint for argument names
263-
argument-name-hint=(([a-z][a-z0-9_]{2,30})|(_[a-z0-9_]*))$
264-
265254
# Regular expression matching correct argument names
266255
argument-rgx=(([a-z][a-z0-9_]{2,30})|(_[a-z0-9_]*))$
267256

268-
# Naming hint for attribute names
269-
attr-name-hint=(([a-z][a-z0-9_]{2,30})|(_[a-z0-9_]*))$
270-
271257
# Regular expression matching correct attribute names
272258
attr-rgx=(([a-z][a-z0-9_]{2,30})|(_[a-z0-9_]*))$
273259

274260
# Bad variable names which should always be refused, separated by a comma
275261
bad-names=foo,bar,baz,toto,tutu,tata
276262

277-
# Naming hint for class attribute names
278-
class-attribute-name-hint=([A-Za-z_][A-Za-z0-9_]{2,30}|(__.*__))$
279-
280263
# Regular expression matching correct class attribute names
281264
class-attribute-rgx=([A-Za-z_][A-Za-z0-9_]{2,30}|(__.*__))$
282265

283-
# Naming hint for class names
284-
# class-name-hint=[A-Z_][a-zA-Z0-9]+$
285-
class-name-hint=[A-Z_][a-zA-Z0-9_]+$
286-
287266
# Regular expression matching correct class names
288267
# class-rgx=[A-Z_][a-zA-Z0-9]+$
289268
class-rgx=[A-Z_][a-zA-Z0-9_]+$
290269

291-
# Naming hint for constant names
292-
const-name-hint=(([A-Z_][A-Z0-9_]*)|(__.*__))$
293-
294270
# Regular expression matching correct constant names
295271
const-rgx=(([A-Z_][A-Z0-9_]*)|(__.*__))$
296272

297273
# Minimum line length for functions/classes that require docstrings, shorter
298274
# ones are exempt.
299275
docstring-min-length=-1
300276

301-
# Naming hint for function names
302-
function-name-hint=(([a-z][a-z0-9_]{2,30})|(_[a-z0-9_]*))$
303-
304277
# Regular expression matching correct function names
305278
function-rgx=(([a-z][a-z0-9_]{2,30})|(_[a-z0-9_]*))$
306279

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

314-
# Naming hint for inline iteration names
315-
inlinevar-name-hint=[A-Za-z_][A-Za-z0-9_]*$
316-
317287
# Regular expression matching correct inline iteration names
318288
inlinevar-rgx=[A-Za-z_][A-Za-z0-9_]*$
319289

320-
# Naming hint for method names
321-
method-name-hint=(([a-z][a-z0-9_]{2,30})|(_[a-z0-9_]*))$
322-
323290
# Regular expression matching correct method names
324291
method-rgx=(([a-z][a-z0-9_]{2,30})|(_[a-z0-9_]*))$
325292

326-
# Naming hint for module names
327-
module-name-hint=(([a-z_][a-z0-9_]*)|([A-Z][a-zA-Z0-9]+))$
328-
329293
# Regular expression matching correct module names
330294
module-rgx=(([a-z_][a-z0-9_]*)|([A-Z][a-zA-Z0-9]+))$
331295

@@ -341,9 +305,6 @@ no-docstring-rgx=^_
341305
# to this list to register other decorators that produce valid properties.
342306
property-classes=abc.abstractproperty
343307

344-
# Naming hint for variable names
345-
variable-name-hint=(([a-z][a-z0-9_]{2,30})|(_[a-z0-9_]*))$
346-
347308
# Regular expression matching correct variable names
348309
variable-rgx=(([a-z][a-z0-9_]{2,30})|(_[a-z0-9_]*))$
349310

@@ -435,4 +396,4 @@ min-public-methods=1
435396

436397
# Exceptions that will emit a warning when being caught. Defaults to
437398
# "Exception"
438-
overgeneral-exceptions=Exception
399+
overgeneral-exceptions=builtins.Exception

adafruit_platformdetect/board.py

Lines changed: 1 addition & 1 deletion
Original file line numberDiff line numberDiff line change
@@ -123,7 +123,7 @@ def id(self) -> Optional[str]:
123123
board_id = self._sifive_id()
124124
elif chip_id == chips.C906:
125125
board_id = self._allwinner_id()
126-
elif chip_id == chips.JH71x0:
126+
elif chip_id == chips.JH71X0:
127127
board_id = self._beaglebone_id()
128128
elif chip_id == chips.MCP2221:
129129
board_id = boards.MICROCHIP_MCP2221

adafruit_platformdetect/chip.py

Lines changed: 2 additions & 2 deletions
Original file line numberDiff line numberDiff line change
@@ -212,11 +212,11 @@ def _linux_id(self) -> Optional[str]:
212212

213213
# Older Builds
214214
if self.detector.check_dt_compatible_value("sifive"):
215-
return chips.JH71x0
215+
return chips.JH71X0
216216

217217
# Newer Builds
218218
if self.detector.check_dt_compatible_value("jh7100"):
219-
return chips.JH71x0
219+
return chips.JH71X0
220220

221221
if self.detector.check_dt_compatible_value("sun8i-a33"):
222222
return chips.A33

adafruit_platformdetect/constants/chips.py

Lines changed: 1 addition & 1 deletion
Original file line numberDiff line numberDiff line change
@@ -38,7 +38,7 @@
3838
FT2232H = "FT2232H"
3939
HFU540 = "HFU540"
4040
C906 = "C906"
41-
JH71x0 = "JH71x0"
41+
JH71X0 = "JH71X0"
4242
MCP2221 = "MCP2221"
4343
BINHO = "BINHO"
4444
MIPS24KC = "MIPS24KC"

adafruit_platformdetect/revcodes.py

Lines changed: 7 additions & 2 deletions
Original file line numberDiff line numberDiff line change
@@ -168,7 +168,9 @@ def is_valid_code(self):
168168
if not self._valid_value(prop_value, values):
169169
return False
170170
else:
171-
if (self.rev_code & 0xFFFF) not in OLD_REV_LUT.keys():
171+
if (
172+
self.rev_code & 0xFFFF
173+
) not in OLD_REV_LUT.keys(): # pylint: disable=consider-iterating-dictionary
172174
return False
173175
for code_format in OLD_REV_STRUCTURE.values():
174176
index, values = code_format
@@ -196,7 +198,10 @@ def _get_bits_value(self, lower_bit, bit_size):
196198
return (self.rev_code >> lower_bit) & ((1 << bit_size) - 1)
197199

198200
def _get_old_rev_prop_value(self, name, raw=False):
199-
if name not in OLD_REV_STRUCTURE.keys():
201+
if (
202+
name
203+
not in OLD_REV_STRUCTURE.keys() # pylint: disable=consider-iterating-dictionary
204+
):
200205
raise ValueError(f"Unknown property {name}")
201206
index, values = OLD_REV_STRUCTURE[name]
202207
data = OLD_REV_LUT[self.rev_code & 0xFFFF]

bin/rpi_info.py

Lines changed: 0 additions & 2 deletions
Original file line numberDiff line numberDiff line change
@@ -26,8 +26,6 @@
2626
import adafruit_platformdetect
2727
from adafruit_platformdetect.revcodes import PiDecoder
2828

29-
pi_rev_code = None
30-
3129
detector = adafruit_platformdetect.Detector()
3230
pi_rev_code = detector.board._pi_rev_code() # pylint: disable=protected-access
3331

0 commit comments

Comments
 (0)