Skip to content

Commit

Permalink
Merge pull request #1551 from PyCQA/show-pycodestyle-in-help
Browse files Browse the repository at this point in the history
re-show pycodestyle in help after plugin gen
  • Loading branch information
asottile committed Feb 6, 2022
2 parents ddae449 + 58ade57 commit 0ecfb90
Show file tree
Hide file tree
Showing 2 changed files with 12 additions and 13 deletions.
3 changes: 1 addition & 2 deletions src/flake8/plugins/finder.py
Original file line number Diff line number Diff line change
Expand Up @@ -162,12 +162,11 @@ def _flake8_plugins(

if ep.name == "F":
yield Plugin(pyflakes_meta["name"], pyflakes_meta["version"], ep)
elif ep.name.startswith("pycodestyle"):
elif ep.name in "EW":
# pycodestyle provides both `E` and `W` -- but our default select
# handles those
# ideally pycodestyle's plugin entrypoints would exactly represent
# the codes they produce...
ep = importlib_metadata.EntryPoint("E", ep.value, ep.group)
yield Plugin(
pycodestyle_meta["name"], pycodestyle_meta["version"], ep
)
Expand Down
22 changes: 11 additions & 11 deletions tests/unit/plugins/finder_test.py
Original file line number Diff line number Diff line change
Expand Up @@ -118,8 +118,8 @@ def flake8_dist(tmp_path):
[flake8.extension]
F = flake8.plugins.pyflakes:FlakesChecker
pycodestyle.bare_except = pycodestyle:bare_except
pycodestyle.blank_lines = pycodestyle:blank_lines
E = flake8.plugins.pycodestyle:pycodestyle_logical
W = flake8.plugins.pycodestyle:pycodestyle_physical
[flake8.report]
default = flake8.formatting.default:Default
Expand Down Expand Up @@ -181,16 +181,16 @@ def test_flake8_plugins(flake8_dist, mock_distribution):
"9000.2.0",
importlib_metadata.EntryPoint(
"E",
"pycodestyle:bare_except",
"flake8.plugins.pycodestyle:pycodestyle_logical",
"flake8.extension",
),
),
finder.Plugin(
"pycodestyle",
"9000.2.0",
importlib_metadata.EntryPoint(
"E",
"pycodestyle:blank_lines",
"W",
"flake8.plugins.pycodestyle:pycodestyle_physical",
"flake8.extension",
),
),
Expand Down Expand Up @@ -276,16 +276,16 @@ def test_importlib_plugins(
"9000.2.0",
importlib_metadata.EntryPoint(
"E",
"pycodestyle:bare_except",
"flake8.plugins.pycodestyle:pycodestyle_logical",
"flake8.extension",
),
),
finder.Plugin(
"pycodestyle",
"9000.2.0",
importlib_metadata.EntryPoint(
"E",
"pycodestyle:blank_lines",
"W",
"flake8.plugins.pycodestyle:pycodestyle_physical",
"flake8.extension",
),
),
Expand Down Expand Up @@ -512,16 +512,16 @@ def test_find_plugins(
"9000.2.0",
importlib_metadata.EntryPoint(
"E",
"pycodestyle:bare_except",
"flake8.plugins.pycodestyle:pycodestyle_logical",
"flake8.extension",
),
),
finder.Plugin(
"pycodestyle",
"9000.2.0",
importlib_metadata.EntryPoint(
"E",
"pycodestyle:blank_lines",
"W",
"flake8.plugins.pycodestyle:pycodestyle_physical",
"flake8.extension",
),
),
Expand Down

0 comments on commit 0ecfb90

Please sign in to comment.