Skip to content

Conversation

@ahaooahaz
Copy link

@ahaooahaz ahaooahaz commented Dec 2, 2025

Output in standard JSON format so that it can be parsed with tools like jq in the shell.

Copy link

Copilot AI left a comment

Choose a reason for hiding this comment

The reason will be displayed to describe this comment to others. Learn more.

Pull request overview

This PR enhances the device listing functionality by supporting both available and all devices, outputting results in standard JSON format for improved shell tool compatibility (e.g., jq).

Key changes:

  • Modified --list argument from a simple flag to accept optional values ('available' or 'all')
  • Wrapped list_devices() output with json.dumps() for standard JSON formatting
  • Added available_filter parameter to control device filtering based on list mode

💡 Add Copilot custom instructions for smarter, more guided reviews. Learn how to get started.


if args.list:
print(client.list_devices(requirements=requirement))
print(json.dumps(client.list_devices(requirements=requirement, available_filter=(args.list!='all'))))
Copy link

Copilot AI Dec 2, 2025

Choose a reason for hiding this comment

The reason will be displayed to describe this comment to others. Learn more.

Missing spaces around the != operator. According to PEP 8 and the codebase convention, there should be spaces around comparison operators.

Suggestion: Change args.list!='all' to args.list != 'all'

Suggested change
print(json.dumps(client.list_devices(requirements=requirement, available_filter=(args.list!='all'))))
print(json.dumps(client.list_devices(requirements=requirement, available_filter=(args.list != 'all'))))

Copilot uses AI. Check for mistakes.
Copy link

Copilot AI left a comment

Choose a reason for hiding this comment

The reason will be displayed to describe this comment to others. Learn more.

Copilot encountered an error and was unable to review this pull request. You can try again by re-requesting a review.

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.

1 participant