Skip to content

Commit

Permalink
Fix case with parameter after *args
Browse files Browse the repository at this point in the history
  • Loading branch information
rmshaffer committed Aug 23, 2023
1 parent 9918625 commit 09e6b4f
Show file tree
Hide file tree
Showing 2 changed files with 11 additions and 1 deletion.
2 changes: 1 addition & 1 deletion src/braket/flake8_plugins/braket_checkstyle_plugin.py
Original file line number Diff line number Diff line change
Expand Up @@ -259,7 +259,7 @@ def _check_argument_order(
) -> None:
expected_index = 0
if context.previous_arg is None:
if node.args.args[0].arg in self.RESERVED_ARGS:
if node.args.args and node.args.args[0].arg in self.RESERVED_ARGS:
expected_index = 1
elif arg_type == context.previous_arg[1]:
expected_index = context.previous_arg[0] + 1
Expand Down
Original file line number Diff line number Diff line change
Expand Up @@ -151,6 +151,16 @@ def function_14(name: str, *, control: int = 0, target: int = 1) -> int:
pass


def function_15(*args, a0: int) -> int:
"""This is a description.
Args:
a0 (int): This is a parameter
Returns:
int: value of the function
"""
pass


class MyClass:
def __init__(self, a0:int):
"""
Expand Down

0 comments on commit 09e6b4f

Please sign in to comment.