Skip to content

Commit 23e0e97

Browse files
committed
Ignore click commands/groups not directly decorated with @click.command (e.g. commands of groups via a variable)
1 parent 8aa7965 commit 23e0e97

File tree

2 files changed

+13
-0
lines changed

2 files changed

+13
-0
lines changed

flake8_params/__init__.py

Lines changed: 2 additions & 0 deletions
Original file line numberDiff line numberDiff line change
@@ -50,6 +50,8 @@
5050
".setter", # Property setter
5151
".command", # Probably a click command
5252
".group", # Probably a click group
53+
"click.argument", # Probably a click command or group
54+
"click.option", # Probably a click command or group
5355
".fixture", # Probably a pytest fixture
5456
}
5557

tests/example_code.py

Lines changed: 11 additions & 0 deletions
Original file line numberDiff line numberDiff line change
@@ -388,3 +388,14 @@ def a_fixture(foo) -> str:
388388
"""
389389

390390
return "abc"
391+
392+
393+
click_command = click.command
394+
395+
396+
@click.argument("-f", "--foo")
397+
@click_command()
398+
def another_command(foo):
399+
"""
400+
Command line entry point.
401+
"""

0 commit comments

Comments
 (0)