Skip to content

Fix args passed to check_config script#155885

Merged
kellerza merged 5 commits into
home-assistant:devfrom
tmonck:fix-check-config
Nov 6, 2025
Merged

Fix args passed to check_config script#155885
kellerza merged 5 commits into
home-assistant:devfrom
tmonck:fix-check-config

Conversation

@tmonck
Copy link
Copy Markdown
Contributor

@tmonck tmonck commented Nov 6, 2025

Breaking change

Proposed change

Continue to allow args passed in any order for the script check_config.

Type of change

  • Dependency upgrade
  • Bugfix (non-breaking change which fixes an issue)
  • New integration (thank you!)
  • New feature (which adds functionality to an existing integration)
  • Deprecation (breaking change to happen in the future)
  • Breaking change (fix/feature causing existing functionality to break)
  • Code quality improvements to existing code or addition of tests

Additional information

  • This PR fixes or closes issue: fixes #
  • This PR is related to issue:
  • Link to documentation pull request:
  • Link to developer documentation pull request:
  • Link to frontend pull request:

Related to the #152575 as that is where the passing of script_args was introduced.

Checklist

  • I understand the code I am submitting and can explain how it works.
  • The code change is tested and works locally.
  • Local tests pass. Your PR cannot be merged unless tests pass
  • There is no commented out code in this PR.
  • I have followed the development checklist
  • I have followed the perfect PR recommendations
  • The code has been formatted using Ruff (ruff format homeassistant tests)
  • Tests have been added to verify that the new code works.
  • Any generated code has been carefully reviewed for correctness and compliance with project standards.

If user exposed functionality or configuration variables are added/changed:

If the code communicates with devices, web services, or third-party tools:

  • The manifest file has all fields filled out correctly.
    Updated and included derived files by running: python3 -m script.hassfest.
  • New or updated dependencies have been added to requirements_all.txt.
    Updated by running python3 -m script.gen_requirements_all.
  • For the updated dependencies - a link to the changelog, or at minimum a diff between library versions is added to the PR description.

To help with the load of incoming pull requests:

@tmonck tmonck requested a review from kellerza as a code owner November 6, 2025 03:11
Copilot AI review requested due to automatic review settings November 6, 2025 03:11
@home-assistant home-assistant Bot added cla-signed core small-pr PRs with less than 30 lines. labels Nov 6, 2025
Copy link
Copy Markdown
Contributor

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 modifies the check_config script to handle cases where script_args is an empty list by falling back to parsing all CLI arguments. The change is intended to support out-of-order argument scenarios where arguments passed to the main Home Assistant command might not be properly forwarded to the script.

  • Updates argument parsing logic to use script_args or None instead of just script_args
  • Adds explanatory comments describing the out-of-order argument scenario

Comment thread homeassistant/scripts/check_config.py Outdated
Comment thread homeassistant/scripts/check_config.py Outdated
Comment thread homeassistant/scripts/check_config.py Outdated
Comment thread homeassistant/scripts/check_config.py Outdated
@home-assistant
Copy link
Copy Markdown
Contributor

home-assistant Bot commented Nov 6, 2025

Please take a look at the requested changes, and use the Ready for review button when you are done, thanks 👍

Learn more about our pull request process.

@home-assistant home-assistant Bot marked this pull request as draft November 6, 2025 09:06
@kellerza kellerza added the bug label Nov 6, 2025
Co-authored-by: Johann Kellerman <kellerza@gmail.com>
@tmonck tmonck marked this pull request as ready for review November 6, 2025 11:24
@home-assistant home-assistant Bot requested a review from kellerza November 6, 2025 11:24
@kellerza
Copy link
Copy Markdown
Member

kellerza commented Nov 6, 2025

You will have to fix all tests that uses the script_args - for example:

check_config.run(flags) --> patch(. flags) and check_config.run()

@tmonck
Copy link
Copy Markdown
Contributor Author

tmonck commented Nov 6, 2025

You will have to fix all tests that uses the script_args - for example:

check_config.run(flags) --> patch(. flags) and check_config.run()

Working on that right now.

@kellerza kellerza added bugfix and removed bug labels Nov 6, 2025
@kellerza kellerza changed the title Allow args passed in any order to script check Fix args passed to check_config script Nov 6, 2025
@kellerza kellerza merged commit 6a7de24 into home-assistant:dev Nov 6, 2025
66 checks passed
@kellerza
Copy link
Copy Markdown
Member

kellerza commented Nov 6, 2025

Thanks @tmonck !

@github-actions github-actions Bot locked and limited conversation to collaborators Nov 7, 2025
@agners agners added this to the 2025.11.3 milestone Nov 17, 2025
Sign up for free to subscribe to this conversation on GitHub. Already have an account? Sign in.

Projects

None yet

Development

Successfully merging this pull request may close these issues.

5 participants