Skip to content

Commit efd9823

Browse files
committed
WIP pylint update
1 parent 88df215 commit efd9823

4 files changed

Lines changed: 12 additions & 13 deletions

File tree

.github/workflows/check.yaml

Lines changed: 3 additions & 1 deletion
Original file line numberDiff line numberDiff line change
@@ -10,6 +10,8 @@ jobs:
1010
- "3.9"
1111
- "3.10"
1212
- "3.11"
13+
- "3.12"
14+
- "3.13"
1315
runs-on: ubuntu-latest
1416
steps:
1517
- uses: actions/checkout@v3
@@ -19,5 +21,5 @@ jobs:
1921
- run: make deps deps-dev
2022
- run: make type
2123
- run: make test
22-
- run: make lint
24+
- run: make lint PYLINTFLAGS=--output-format=github
2325
continue-on-error: ${{ contains(github.event.head_commit.message, 'WIP') }}

.pylintrc

Lines changed: 0 additions & 10 deletions
Original file line numberDiff line numberDiff line change
@@ -6,13 +6,3 @@ disable =
66
classes, typecheck
77
jobs = 0
88
output-format = colorized
9-
10-
[basic]
11-
# Remove length constraints (see
12-
# https://github.com/pylint-dev/pylint/blob/main/pylint/checkers/base/name_checker/naming_style.py)
13-
argument-rgx = ([^\W\dA-Z][^\WA-Z]*|_[^\WA-Z]*|__[^\WA-Z\d_][^\WA-Z]*__)$
14-
class-rgx = [^\W\da-z][^\W_]*$
15-
attr-rgx = %(argument-rgx)s
16-
function-rgx = %(argument-rgx)s
17-
method-rgx = %(argument-rgx)s
18-
variable-rgx = %(argument-rgx)s

Makefile

Lines changed: 2 additions & 1 deletion
Original file line numberDiff line numberDiff line change
@@ -1,6 +1,7 @@
11
PYTHON=python3
22
PIP=pip3
33
PIPFLAGS=--upgrade
4+
PYLINTFLAGS=
45
NPM=npm
56
NPMFLAGS=--no-save
67

@@ -14,7 +15,7 @@ type:
1415

1516
.PHONY: lint
1617
lint:
17-
pylint flatdir
18+
pylint $(PYLINTFLAGS) flatdir
1819

1920
.PHONY: check
2021
check: type test lint

flatdir/util.py

Lines changed: 7 additions & 1 deletion
Original file line numberDiff line numberDiff line change
@@ -17,7 +17,6 @@
1717

1818
from collections.abc import Mapping
1919
from enum import Enum
20-
from importlib.abc import Traversable
2120
from itertools import chain
2221
import logging
2322
from logging import Formatter, LogRecord, StreamHandler
@@ -27,6 +26,13 @@
2726
from typing import Iterable, Literal, TextIO, TypeVar, cast, overload
2827
from xml.etree.ElementTree import Element
2928

29+
if sys.version_info <= (3, 11):
30+
# Work around https://github.com/pylint-dev/pylint/issues/9533
31+
# pylint: disable=deprecated-class
32+
from importlib.abc import Traversable
33+
else:
34+
from importlib.resources.abc import Traversable
35+
3036
FormatStyle = Literal['%', '{', '$']
3137

3238
T = TypeVar('T')

0 commit comments

Comments
 (0)