-
Notifications
You must be signed in to change notification settings - Fork 137
fix: Add linting rule to enforce unused parameter rule #190
New issue
Have a question about this project? Sign up for a free GitHub account to open an issue and contact its maintainers and the community.
By clicking “Sign up for GitHub”, you agree to our terms of service and privacy statement. We’ll occasionally send you account related emails.
Already on GitHub? Sign in to your account
base: main
Are you sure you want to change the base?
Conversation
@@ -626,7 +624,7 @@ def test_agent_tool_tool_does_not_exist(agent): | |||
|
|||
|
|||
@pytest.mark.parametrize("tools", [None, [tool_decorated]], indirect=True) | |||
def test_agent_tool_names(tools, agent): | |||
def test_agent_tool_names(agent): |
There was a problem hiding this comment.
Choose a reason for hiding this comment
The reason will be displayed to describe this comment to others. Learn more.
The pytest parametrize attribute still references tools here - is that expected?
Is it still doing what it should be doing in that case?
@@ -119,6 +119,7 @@ def test__init__with_region_and_session_raises_value_error(): | |||
|
|||
def test__init__default_user_agent(bedrock_client): | |||
"""Set user agent when no boto_client_config is provided.""" | |||
_ = bedrock_client |
There was a problem hiding this comment.
Choose a reason for hiding this comment
The reason will be displayed to describe this comment to others. Learn more.
Can we turn this into an autofixture instead or use usefixtures
? E.g. is there a reason we need to have it as a parameter or use
@@ -21,7 +21,7 @@ def run_tools( | |||
handler: Callable[[ToolUse], ToolResult], | |||
tool_uses: List[ToolUse], | |||
event_loop_metrics: EventLoopMetrics, | |||
request_state: Any, | |||
_request_state: Any, |
There was a problem hiding this comment.
Choose a reason for hiding this comment
The reason will be displayed to describe this comment to others. Learn more.
We should just remove this parameter I think? No need to pass it if it's not used
Description
Added a linting rule
ARG
that checks for unused parameters in functions and class methods.Documentation reference : https://docs.astral.sh/ruff/rules/#flake8-unused-arguments-arg
Related Issues
#128
Type of Change
[Choose one of the above types of changes]
Testing
[How have you tested the change?]
hatch fmt --linter
hatch fmt --formatter
hatch test --all
Checklist
By submitting this pull request, I confirm that you can use, modify, copy, and redistribute this contribution, under the terms of your choice.