Skip to content

Commit 68e7cb7

Browse files
authored
Fix linting (#875)
* Split linting into two steps * Fix an overly long line * Run linter with Python 3.9 * Ignore more errors in test linting
1 parent 6a6f807 commit 68e7cb7

File tree

3 files changed

+20
-9
lines changed

3 files changed

+20
-9
lines changed

.flake8-tests

Lines changed: 10 additions & 2 deletions
Original file line numberDiff line numberDiff line change
@@ -11,17 +11,25 @@ builtins = basestring, unicode
1111
max-line-length = 100
1212
ignore =
1313
# temporary ignores until we sort it out
14+
B017,
15+
E302,
16+
E303,
1417
E306,
18+
E501,
1519
E701,
1620
E704,
21+
F722,
1722
F811,
23+
F821,
24+
F841,
25+
W503,
1826
# irrelevant plugins
1927
B3,
20-
DW12
28+
DW12,
2129
# consistency with mypy
2230
W504
2331
exclude =
2432
# This config is NOT for the main module.
25-
setup.py
33+
setup.py,
2634
python2/typing.py,
2735
src/typing.py

.github/workflows/ci.yml

Lines changed: 7 additions & 6 deletions
Original file line numberDiff line numberDiff line change
@@ -44,7 +44,7 @@ jobs:
4444
pytest $PYTHONPATH
4545
4646
linting:
47-
name: Run linting
47+
name: Lint
4848

4949
runs-on: ubuntu-latest
5050

@@ -54,14 +54,15 @@ jobs:
5454
- name: Set up Python
5555
uses: actions/setup-python@v2
5656
with:
57-
python-version: 3.8
57+
python-version: 3.9
5858

5959
- name: Install dependencies
6060
run: |
6161
python -m pip install --upgrade pip
6262
pip install -r test-requirements.txt
6363
64-
- name: Run linting
65-
run: |
66-
flake8
67-
flake8 --config=.flake8-tests src/test_typing.py python2/test_typing.py typing_extensions/src_py2/test_typing_extensions.py typing_extensions/src_py3/test_typing_extensions.py
64+
- name: Lint implementation
65+
run: flake8
66+
67+
- name: Lint tests
68+
run: flake8 --config=.flake8-tests src/test_typing.py python2/test_typing.py typing_extensions/src_py2/test_typing_extensions.py typing_extensions/src_py3/test_typing_extensions.py

typing_extensions/src_py3/typing_extensions.py

Lines changed: 3 additions & 1 deletion
Original file line numberDiff line numberDiff line change
@@ -2428,7 +2428,9 @@ def __call__(self, *args, **kwargs):
24282428

24292429
@property
24302430
def __parameters__(self):
2431-
return tuple(tp for tp in self.__args__ if isinstance(tp, (TypeVar, ParamSpec)))
2431+
return tuple(
2432+
tp for tp in self.__args__ if isinstance(tp, (TypeVar, ParamSpec))
2433+
)
24322434

24332435
if not PEP_560:
24342436
# Only required in 3.6 and lower.

0 commit comments

Comments
 (0)