Repository navigation
Conversation
Flag README.md, hacs.json and info.md in the integration folder, and changes to copilot instructions, CLAUDE.md, AGENTS.md or .pre-commit-config.yaml. Co-Authored-By: Claude Opus 5.5 <noreply@anthropic.com> Claude-Session: https://claude.ai/code/session_01SLHDn8LpzmRxdqCcYbr6Zs
README.md, hacs.json and info.md added in an integration folder are now reported by the core forbidden-files check for every PR. The new-integration check keeps flagging changes to copilot instructions, CLAUDE.md, AGENTS.md and .pre-commit-config.yaml. Co-Authored-By: Claude Opus 5.5 <noreply@anthropic.com> Claude-Session: https://claude.ai/code/session_01SLHDn8LpzmRxdqCcYbr6Zs
|
@copilot resolve the merge conflicts in this pull request |
Co-Authored-By: Claude Opus 5.5 <noreply@anthropic.com> Claude-Session: https://claude.ai/code/session_01SLHDn8LpzmRxdqCcYbr6Zs
|
Merge conflicts are resolved: I merged Generated by Claude Code |
| const STRAY_REPO_FILES = new Set([ | ||
| "copilot-instructions.md", | ||
| "claude.md", | ||
| "agents.md", | ||
| ".pre-commit-config.yaml", | ||
| ]); |
There was a problem hiding this comment.
Would it make sense to make it a whitelist instead of a blacklist? Say we ban everything that changes files outside the integration folder + a few exceptions like homeassistant/generated/**, CODEOWNERS, etc.
There was a problem hiding this comment.
Hmm, I guess that could make sense, and we could make it so that we do allow it when the quality scale is internal, as adding a new entity platform or whatever feature, can cover more files (like the location suggestion PR also touches stuff like hassfest and the loader)
There was a problem hiding this comment.
Switched to an allowlist in b899339. A new-integration PR may now only change the new integration's own homeassistant/components/<domain>/ and tests/components/<domain>/ folders, plus:
homeassistant/generated/**homeassistant/brands/*.jsonCODEOWNERSrequirements_all.txtandrequirements_test_all.txt.strict-typingandmypy.ini
Anything else, including other integrations, is listed (up to five paths) with a request to move it to a separate PR. When the new integration's manifest has quality_scale: internal, the check is skipped.
I checked this against the 30 most recently merged new-integration PRs in core. None of them would be flagged. The only one that touched files outside this list (voice_support: assist_pipeline, script/hassfest/quality_scale.py, tests/snapshots/test_bootstrap.ambr) is internal.
Generated by Claude Code
…its folder Replace the list of stray tooling files with an allowlist: a new-integration PR may only change its own integration and test folders, generated files, brand metadata, CODEOWNERS, requirements and typing config. Internal integrations are exempt, since they often extend hassfest, the loader or other integrations. Co-Authored-By: Claude Opus 5.5 <noreply@anthropic.com> Claude-Session: https://claude.ai/code/session_01SLHDn8LpzmRxdqCcYbr6Zs
Use the newIntegrationDomains helper from main instead of a local copy. Co-Authored-By: Claude Opus 5.5 <noreply@anthropic.com> Claude-Session: https://claude.ai/code/session_01SLHDn8LpzmRxdqCcYbr6Zs
Proposed change
New-integration PRs regularly come in with leftovers from a custom integration or from the contributor's local tooling (about 20 recent PRs). This catches them in two places:
forbidden-files(all PRs intodev): adds a core entry forREADME.md,hacs.jsonorinfo.mdadded directly inhomeassistant/components/<domain>/(case-insensitive). Existing READMEs (prometheus,tplink,zwave_js) can still be edited or removed. The message points to home-assistant.io for documentation.new-integration-validation: fails when a new-integration PR changes files outside the new integration's ownhomeassistant/components/<domain>/andtests/components/<domain>/folders, other than an allowlist:homeassistant/generated/**,homeassistant/brands/*.json,CODEOWNERS,requirements_all.txt,requirements_test_all.txt,.strict-typingandmypy.ini. That covers copilot instructions,CLAUDE.md,AGENTS.md,.pre-commit-config.yamland anything else, including other integrations. Integrations withquality_scale: internalare exempt, since they often extend hassfest, the loader or other integrations. Against the 30 most recently mergednew-integrationPRs in core this flags none; the only one touching other files (voice_support) is internal.Type of change
Additional information
Checklist
mise run test). Your PR cannot be merged unless tests pass.mise run check).mise run format).If behaviour, configuration, or environment variables changed:
README.mdand.env.examplehave been updated accordingly.https://claude.ai/code/session_01SLHDn8LpzmRxdqCcYbr6Zs
Generated by Claude Code