Skip to content

Commit 057c01d

Browse files
committed
Apply pycodestyles autofixes
1 parent c7c8e26 commit 057c01d

File tree

747 files changed

+126
-2158
lines changed

Some content is hidden

Large Commits have some content hidden by default. Use the searchbox below for content that may be hidden.

747 files changed

+126
-2158
lines changed

pyproject.toml

Lines changed: 29 additions & 1 deletion
Original file line numberDiff line numberDiff line change
@@ -27,8 +27,36 @@ line-length = 130
2727
target-version = "py39"
2828

2929
[tool.ruff.lint]
30-
select = [
30+
extend-select = [
31+
"FA", # flake8-future-annotations
3132
"I", # isort
33+
"W", # pycodestyle Warning
34+
]
35+
ignore= [
36+
###
37+
# Rules we don't want or don't agree with
38+
###
39+
# Used for direct, non-subclass type comparison, for example: `type(val) is str`
40+
# see https://github.com/astral-sh/ruff/issues/6465
41+
"E721", # Do not compare types, use `isinstance()`
42+
43+
# TODO: Investigate and fix or configure
44+
"E402",
45+
"E722",
46+
"E743",
47+
"F811",
48+
"F822",
49+
"F841",
50+
"F842",
51+
]
52+
[tool.ruff.lint.per-file-ignores]
53+
"*.pyi" = [
54+
# Rules that are out of the control of stub authors:
55+
"E741", # ambiguous variable name
56+
"F403", # `from . import *` used; unable to detect undefined names
57+
# Stubs can sometimes re-export entire modules.
58+
# Issues with using a star-imported name will be caught by type-checkers.
59+
"F405", # may be undefined, or defined from star imports
3260
]
3361

3462
[tool.ruff.lint.isort]

stubs/matplotlib/__init__.pyi

Lines changed: 1 addition & 4 deletions
Original file line numberDiff line numberDiff line change
@@ -1,10 +1,7 @@
11
import contextlib
22
from typing import Generator, Literal
33

4-
import numpy as np
5-
from packaging.version import parse as parse_version
6-
7-
from . import _docstring, _version, cbook, colors as colors, rcsetup
4+
from . import colors as colors
85
from ._typing import *
96

107
class __getattr__:

stubs/matplotlib/_afm.pyi

Lines changed: 0 additions & 1 deletion
Original file line numberDiff line numberDiff line change
@@ -1,4 +1,3 @@
1-
import numpy as np
21

32
from ._typing import *
43

stubs/matplotlib/_api/__init__.pyi

Lines changed: 1 addition & 1 deletion
Original file line numberDiff line numberDiff line change
@@ -1,5 +1,5 @@
11
import functools
2-
from typing import Any, Callable, Generator, Iterable, Type
2+
from typing import Callable, Generator, Iterable, Type
33

44
from .deprecation import MatplotlibDeprecationWarning
55

stubs/matplotlib/_mathtext.pyi

Lines changed: 0 additions & 1 deletion
Original file line numberDiff line numberDiff line change
@@ -1,6 +1,5 @@
11
import enum
22
import functools
3-
from sre_parse import State
43
from tkinter.tix import HList
54
from typing import Literal
65

stubs/matplotlib/_pylab_helpers.pyi

Lines changed: 1 addition & 1 deletion
Original file line numberDiff line numberDiff line change
@@ -1,4 +1,4 @@
1-
from typing import Any, List, OrderedDict
1+
from typing import OrderedDict
22

33
from .backend_bases import FigureManagerBase
44
from .figure import Figure

stubs/matplotlib/animation.pyi

Lines changed: 1 addition & 3 deletions
Original file line numberDiff line numberDiff line change
@@ -1,9 +1,7 @@
11
import abc
22
import contextlib
33
from itertools import count
4-
from typing import Callable, Generator, Iterable, Iterator, List
5-
6-
from matplotlib.backend_bases import NonGuiException
4+
from typing import Callable, Generator, Iterable, Iterator
75

86
from .figure import Figure
97

stubs/matplotlib/axes/_axes.pyi

Lines changed: 0 additions & 1 deletion
Original file line numberDiff line numberDiff line change
@@ -1,5 +1,4 @@
11
import datetime
2-
from re import L
32
from typing import Callable, Literal, Sequence, overload
43

54
import matplotlib.tri as mtri

stubs/matplotlib/axes/_secondary_axes.pyi

Lines changed: 0 additions & 1 deletion
Original file line numberDiff line numberDiff line change
@@ -1,6 +1,5 @@
11
from typing import Callable, Literal
22

3-
import numpy as np
43
from matplotlib._typing import *
54
from matplotlib.axes._base import _AxesBase
65
from matplotlib.transforms import Transform

stubs/matplotlib/axis.pyi

Lines changed: 0 additions & 1 deletion
Original file line numberDiff line numberDiff line change
@@ -1,5 +1,4 @@
11
import datetime
2-
from datetime import timezone
32
from typing import Any, Callable, Literal, Type
43

54
import numpy as np

0 commit comments

Comments
 (0)