Skip to content

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

Open
wants to merge 3 commits into
base: main
Choose a base branch
from

Conversation

mehtarac
Copy link
Member

@mehtarac mehtarac commented Jun 9, 2025

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

  • Bug fix

[Choose one of the above types of changes]

Testing

[How have you tested the change?]

  • hatch fmt --linter
  • hatch fmt --formatter
  • hatch test --all
  • Verify that the changes do not break functionality or introduce warnings in consuming repositories: agents-docs, agents-tools, agents-cli

Checklist

  • I have read the CONTRIBUTING document
  • I have added tests that prove my fix is effective or my feature works
  • I have updated the documentation accordingly
  • I have added an appropriate example to the documentation to outline the feature
  • My changes generate no new warnings
  • Any dependent changes have been merged and published

By submitting this pull request, I confirm that you can use, modify, copy, and redistribute this contribution, under the terms of your choice.

@mehtarac mehtarac requested a review from a team as a code owner June 9, 2025 13:54
@mehtarac mehtarac requested a review from dbschmigelski June 9, 2025 16:21
@@ -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):
Copy link
Member

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
Copy link
Member

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,
Copy link
Member

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

Sign up for free to join this conversation on GitHub. Already have an account? Sign in to comment
Labels
None yet
Projects
None yet
Development

Successfully merging this pull request may close these issues.

3 participants