Movatterモバイル変換


[0]ホーム

URL:


Skip to content

Navigation Menu

Sign in
Appearance settings

Search code, repositories, users, issues, pull requests...

Provide feedback

We read every piece of feedback, and take your input very seriously.

Saved searches

Use saved searches to filter your results more quickly

Sign up
Appearance settings

Commitf9de8aa

Browse files
authored
Merge pull request#25147 from ksunden/ruff_config
Add ruff config to pyproject.toml for devs who are interested
2 parentseeef80f +f19b57c commitf9de8aa

File tree

7 files changed

+126
-28
lines changed

7 files changed

+126
-28
lines changed

‎.flake8

Lines changed: 7 additions & 21 deletions
Original file line numberDiff line numberDiff line change
@@ -2,32 +2,23 @@
22
max-line-length = 88
33
select =
44
# flake8 default
5-
C90, E, F, W,
6-
# docstring-convention=numpy
7-
D100, D101, D102, D103, D104, D105, D106,
8-
D200, D201, D202, D204, D205, D206, D207, D208,
9-
D209, D210, D211, D214, D215,
10-
D300, D301, D302,
11-
D400, D401, D403, D404, D405, D406, D407, D408,
12-
D409, D410, D411, D412, D414,
13-
# matplotlib-specific extra pydocstyle errors
14-
D213,
5+
D, E, F, W,
156
ignore =
167
# flake8 default
178
E121,E123,E126,E226,E24,E704,W503,W504,
189
# Additional ignores:
1910
E127, E131,
2011
E266,
2112
E305, E306,
22-
E722,E741,
13+
E741,
2314
F841,
24-
# Some new flake8 ignores:
25-
N801, N802, N803, N806, N812,
2615
# pydocstyle
27-
D100, D101, D102, D103, D104, D105, D106, D107,
28-
D200, D202,D203,D204, D205, D207, D212,
16+
D100, D101, D102, D103, D104, D105, D106,
17+
D200, D202, D204, D205,
2918
D301,
30-
D400, D401, D402, D403, D404, D413,
19+
D400, D401, D403, D404
20+
# ignored by pydocstyle numpy docstring convention
21+
D107, D203, D212, D213, D402, D413, D415, D416, D417,
3122

3223
exclude =
3324
.git
@@ -42,7 +33,6 @@ exclude =
4233
per-file-ignores =
4334
setup.py: E402
4435

45-
4636
lib/matplotlib/__init__.py: E402, F401
4737
lib/matplotlib/_animation_data.py: E501
4838
lib/matplotlib/_api/__init__.py: F401
@@ -81,9 +71,6 @@ per-file-ignores =
8171
tutorials/text/mathtext.py: E501
8272
tutorials/text/text_intro.py: E402
8373
tutorials/text/text_props.py: E501
84-
tutorials/text/usetex.py: E501
85-
tutorials/toolkits/axes_grid.py: E501
86-
tutorials/toolkits/axisartist.py: E501
8774

8875
examples/animation/frame_grabbing_sgskip.py: E402
8976
examples/images_contours_and_fields/tricontour_demo.py: E201
@@ -93,7 +80,6 @@ per-file-ignores =
9380
examples/misc/print_stdout_sgskip.py: E402
9481
examples/misc/table_demo.py: E201
9582
examples/style_sheets/bmh.py: E501
96-
examples/style_sheets/plot_solarizedlight2.py: E501
9783
examples/subplots_axes_and_figures/demo_constrained_layout.py: E402
9884
examples/text_labels_and_annotations/custom_legends.py: E402
9985
examples/ticks/date_concise_formatter.py: E402

‎lib/matplotlib/legend_handler.py

Lines changed: 0 additions & 1 deletion
Original file line numberDiff line numberDiff line change
@@ -63,7 +63,6 @@ def __init__(self, xpad=0., ypad=0., update_func=None):
6363
"""
6464
Parameters
6565
----------
66-
6766
xpad : float, optional
6867
Padding in x-direction.
6968
ypad : float, optional

‎lib/matplotlib/scale.py

Lines changed: 1 addition & 1 deletion
Original file line numberDiff line numberDiff line change
@@ -98,7 +98,7 @@ def __init__(self, axis):
9898
# constructor docstring, which would otherwise end up interpolated into
9999
# the docstring of Axis.set_scale.
100100
"""
101-
"""
101+
"""# noqa: D419
102102

103103
defset_default_locators_and_formatters(self,axis):
104104
# docstring inherited

‎lib/matplotlib/tests/test_backend_qt.py

Lines changed: 2 additions & 2 deletions
Original file line numberDiff line numberDiff line change
@@ -128,7 +128,7 @@ def test_sigint(target, kwargs):
128128
try:
129129
proc.wait_for('DRAW')
130130
stdout,_=proc.communicate(timeout=_test_timeout)
131-
except:
131+
exceptException:
132132
proc.kill()
133133
stdout,_=proc.communicate()
134134
raise
@@ -182,7 +182,7 @@ def test_other_signal_before_sigint(target, kwargs):
182182
proc.wait_for('SIGUSR1')
183183
os.kill(proc.pid,signal.SIGINT)
184184
stdout,_=proc.communicate(timeout=_test_timeout)
185-
except:
185+
exceptException:
186186
proc.kill()
187187
stdout,_=proc.communicate()
188188
raise

‎lib/matplotlib/tests/test_font_manager.py

Lines changed: 1 addition & 1 deletion
Original file line numberDiff line numberDiff line change
@@ -317,7 +317,7 @@ def test_get_font_names():
317317
font=ft2font.FT2Font(path)
318318
prop=ttfFontProperty(font)
319319
ttf_fonts.append(prop.name)
320-
except:
320+
exceptException:
321321
pass
322322
available_fonts=sorted(list(set(ttf_fonts)))
323323
mpl_font_names=sorted(fontManager.get_font_names())

‎lib/mpl_toolkits/mplot3d/art3d.py

Lines changed: 1 addition & 1 deletion
Original file line numberDiff line numberDiff line change
@@ -91,7 +91,7 @@ class Text3D(mtext.Text):
9191
----------------
9292
**kwargs
9393
All other parameters are passed on to `~matplotlib.text.Text`.
94-
"""
94+
"""
9595

9696
def__init__(self,x=0,y=0,z=0,text='',zdir='z',**kwargs):
9797
mtext.Text.__init__(self,x,y,text,**kwargs)

‎pyproject.toml

Lines changed: 114 additions & 1 deletion
Original file line numberDiff line numberDiff line change
@@ -7,11 +7,124 @@ requires = [
77
"setuptools_scm>=7",
88
]
99

10-
1110
[tool.isort]
1211
known_mpltoolkits ="mpl_toolkits"
1312
known_pydata ="numpy, matplotlib.pyplot"
1413
known_firstparty ="matplotlib"
1514
sections ="FUTURE,STDLIB,THIRDPARTY,PYDATA,FIRSTPARTY,MPLTOOLKITS,LOCALFOLDER"
1615
no_lines_before ="MPLTOOLKITS"
1716
force_sort_within_sections =true
17+
18+
[tool.ruff]
19+
exclude = [
20+
".git",
21+
"build",
22+
"doc/gallery",
23+
"doc/tutorials",
24+
"tools/gh_api.py",
25+
".tox",
26+
".eggs",
27+
]
28+
ignore = [
29+
"D100",
30+
"D101",
31+
"D102",
32+
"D103",
33+
"D104",
34+
"D105",
35+
"D106",
36+
"D200",
37+
"D202",
38+
"D204",
39+
"D205",
40+
"D301",
41+
"D400",
42+
"D401",
43+
"D403",
44+
"D404",
45+
"E741",
46+
"F841",
47+
]
48+
line-length =88
49+
select = [
50+
"D",
51+
"E",
52+
"F",
53+
"W",
54+
]
55+
56+
# The following error codes are not supported by ruff v0.0.240
57+
# They are planned and should be selected once implemented
58+
# even if they are deselected by default.
59+
# These are primarily whitespace/corrected by autoformatters (which we don't use).
60+
# See https://github.com/charliermarsh/ruff/issues/2402 for status on implementation
61+
external = [
62+
"E122",
63+
"E201",
64+
"E202",
65+
"E203",
66+
"E221",
67+
"E251",
68+
"E261",
69+
"E272",
70+
"E302",
71+
"E703",
72+
]
73+
74+
target-version ="py39"
75+
76+
[tool.ruff.pydocstyle]
77+
convention ="numpy"
78+
79+
[tool.ruff.per-file-ignores]
80+
"setup.py" = ["E402"]
81+
82+
"doc/conf.py" = ["E402"]
83+
"examples/animation/frame_grabbing_sgskip.py" = ["E402"]
84+
"examples/lines_bars_and_markers/marker_reference.py" = ["E402"]
85+
"examples/misc/print_stdout_sgskip.py" = ["E402"]
86+
"examples/style_sheets/bmh.py" = ["E501"]
87+
"examples/subplots_axes_and_figures/demo_constrained_layout.py" = ["E402"]
88+
"examples/text_labels_and_annotations/custom_legends.py" = ["E402"]
89+
"examples/ticks/date_concise_formatter.py" = ["E402"]
90+
"examples/ticks/date_formatters_locators.py" = ["F401"]
91+
"examples/user_interfaces/embedding_in_gtk3_panzoom_sgskip.py" = ["E402"]
92+
"examples/user_interfaces/embedding_in_gtk3_sgskip.py" = ["E402"]
93+
"examples/user_interfaces/embedding_in_gtk4_panzoom_sgskip.py" = ["E402"]
94+
"examples/user_interfaces/embedding_in_gtk4_sgskip.py" = ["E402"]
95+
"examples/user_interfaces/gtk3_spreadsheet_sgskip.py" = ["E402"]
96+
"examples/user_interfaces/gtk4_spreadsheet_sgskip.py" = ["E402"]
97+
"examples/user_interfaces/mpl_with_glade3_sgskip.py" = ["E402"]
98+
"examples/user_interfaces/pylab_with_gtk3_sgskip.py" = ["E402"]
99+
"examples/user_interfaces/pylab_with_gtk4_sgskip.py" = ["E402"]
100+
"examples/userdemo/pgf_preamble_sgskip.py" = ["E402"]
101+
102+
"lib/matplotlib/__init__.py" = ["E402","F401"]
103+
"lib/matplotlib/_animation_data.py" = ["E501"]
104+
"lib/matplotlib/_api/__init__.py" = ["F401"]
105+
"lib/matplotlib/axes/__init__.py" = ["F401","F403"]
106+
"lib/matplotlib/backends/backend_template.py" = ["F401"]
107+
"lib/matplotlib/font_manager.py" = ["E501"]
108+
"lib/matplotlib/image.py" = ["F401","F403"]
109+
"lib/matplotlib/pylab.py" = ["F401","F403"]
110+
"lib/matplotlib/pyplot.py" = ["F401","F811"]
111+
"lib/matplotlib/tests/test_mathtext.py" = ["E501"]
112+
"lib/mpl_toolkits/axisartist/__init__.py" = ["F401"]
113+
"lib/pylab.py" = ["F401","F403"]
114+
115+
"tutorials/advanced/path_tutorial.py" = ["E402"]
116+
"tutorials/advanced/patheffects_guide.py" = ["E402"]
117+
"tutorials/advanced/transforms_tutorial.py" = ["E402","E501"]
118+
"tutorials/colors/colormaps.py" = ["E501"]
119+
"tutorials/colors/colors.py" = ["E402"]
120+
"tutorials/intermediate/artists.py" = ["E402"]
121+
"tutorials/intermediate/constrainedlayout_guide.py" = ["E402"]
122+
"tutorials/intermediate/legend_guide.py" = ["E402"]
123+
"tutorials/intermediate/tight_layout_guide.py" = ["E402"]
124+
"tutorials/introductory/animation_tutorial.py" = ["E501"]
125+
"tutorials/introductory/images.py" = ["E501"]
126+
"tutorials/introductory/pyplot.py" = ["E402","E501"]
127+
"tutorials/text/annotations.py" = ["E402","E501"]
128+
"tutorials/text/mathtext.py" = ["E501"]
129+
"tutorials/text/text_intro.py" = ["E402"]
130+
"tutorials/text/text_props.py" = ["E501"]

0 commit comments

Comments
 (0)

[8]ページ先頭

©2009-2025 Movatter.jp