You signed in with another tab or window. Reload to refresh your session.You signed out in another tab or window. Reload to refresh your session.You switched accounts on another tab or window. Reload to refresh your session.Dismiss alert
-`RUFF_FORMAT_PASSED`: true if ruff format made no changes or only formatting changes that are now fixed
90
-
-`RUFF_CHECK_PASSED`: true if ruff check reports no errors
91
-
-`HASSFEST_PASSED`: true if hassfest completes without errors
82
+
-`PREK_PASSED`: true if `prek run` exits with code 0
83
+
84
+
**If `prek` fails or is not available, STOP and report the failure to the user. Do not proceed with PR creation.**
92
85
93
86
## Step 4: Run Tests
94
87
@@ -139,19 +132,19 @@ Select exactly ONE based on the changes. Mark the selected type with `[x]` and a
139
132
140
133
Based on the verification steps above, determine checkbox states:
141
134
142
-
|Placeholder| Condition to tick |
143
-
|-------------|-------------------|
144
-
|`tested_checkbox`| Tick only if `TESTS_PASSED` is true |
145
-
|`tests_pass_checkbox`| Tick only if `TESTS_PASSED` is true |
146
-
|`no_comments_checkbox`| Tick after verifying in Step 5 |
147
-
|`dev_checklist_checkbox`| Tick only if all Step 5 items pass |
148
-
|`perfect_pr_checkbox`| Tick if PR is focused on single change |
149
-
|`ruff_checkbox`| Tick only if `RUFF_FORMAT_PASSED` and `RUFF_CHECK_PASSED`|
150
-
|`tests_added_checkbox`| Tick only if test files were added/modified with new test functions |
151
-
|`docs_checkbox`| Tick if documentation PR created (or not applicable) |
152
-
|`manifest_checkbox`| Tick if `HASSFEST_PASSED` is true (or not applicable) |
153
-
|`requirements_checkbox`| Tick if requirements_all.txt updated (or not applicable) |
154
-
|`changelog_checkbox`| Tick if dependency changelog linked in PR description (or not applicable) |
135
+
|Checkbox| Condition to tick |
136
+
|----------|-------------------|
137
+
|The code change is tested and works locally| Tick only if `TESTS_PASSED` is true |
138
+
|Local tests pass| Tick only if `TESTS_PASSED` is true |
139
+
|There is no commented out code| Tick after verifying in Step 5 |
140
+
|Development checklist| Tick only if all Step 5 items pass |
141
+
|Perfect PR recommendations| Tick if PR is focused on single change |
142
+
|Formatted using Ruff | Tick only if `PREK_PASSED` is true|
143
+
|Tests have been added| Tick only if test files were added/modified with new test functions |
144
+
|Documentation added/updated| Tick if documentation PR created (or not applicable) |
145
+
|Manifest file fields filled out | Tick if `PREK_PASSED` is true (or not applicable) |
146
+
|Dependencies in requirements_all.txt| Tick if requirements_all.txt updated (or not applicable) |
147
+
|Dependency changelog linked| Tick if dependency changelog linked in PR description (or not applicable) |
155
148
156
149
## Step 8: Breaking Change Section
157
150
@@ -164,13 +157,13 @@ If it IS breaking or deprecation, keep the `## Breaking change` section and desc
164
157
165
158
## Step 9: Stage Any Changes from Checks
166
159
167
-
If ruff or hassfest made changes, stage them:
160
+
If `prek` made any formatting or generated file changes, stage and commit them as a separate commit:
168
161
169
162
```bash
170
163
git status --porcelain
171
164
# If changes exist:
172
165
git add -A
173
-
git commit --amend --no-edit
166
+
git commit -m "Apply prek formatting and generated file updates"
174
167
```
175
168
176
169
## Step 10: Push Branch and Create PR
@@ -180,8 +173,8 @@ git commit --amend --no-edit
180
173
BRANCH=$(git branch --show-current)
181
174
GITHUB_USER=$(git remote get-url origin | sed -E 's/.*[:/]([^/]+)\/core.*/\1/')
182
175
183
-
# Push branch (force if we amended)
184
-
git push -u origin "$BRANCH" --force-with-lease
176
+
# Push branch
177
+
git push -u origin "$BRANCH"
185
178
186
179
# Create PR
187
180
gh pr create --repo home-assistant/core --base dev \
@@ -195,72 +188,17 @@ EOF
195
188
196
189
## PR Body Template
197
190
198
-
Construct the body based on all verification results. **Important: Preserve all template options exactly as shown - only modify checkbox states, do not remove unselected items or reorder sections.**
199
-
200
-
```markdown
201
-
## Breaking change
202
-
203
-
[If type is "Breaking change" or "Deprecation", describe what breaks, how users can fix it, and why. Otherwise, REMOVE this entire section including the heading.]
204
-
205
-
## Proposed change
206
-
207
-
[Describe the change and why - extract from commit messages]
208
-
209
-
## Type of change
210
-
211
-
-[{dependency_checkbox}] Dependency upgrade
212
-
-[{bugfix_checkbox}] Bugfix (non-breaking change which fixes an issue)
213
-
-[{new_integration_checkbox}] New integration (thank you!)
214
-
-[{new_feature_checkbox}] New feature (which adds functionality to an existing integration)
215
-
-[{deprecation_checkbox}] Deprecation (breaking change to happen in the future)
216
-
-[{breaking_checkbox}] Breaking change (fix/feature causing existing functionality to break)
217
-
-[{code_quality_checkbox}] Code quality improvements to existing code or addition of tests
218
-
219
-
## Additional information
191
+
Read the PR template from `.github/PULL_REQUEST_TEMPLATE.md` and use it as the basis for the PR body. **Do not hardcode the template — always read it from the file to stay in sync with upstream changes.**
220
192
221
-
- This PR fixes or closes issue: fixes #
222
-
- This PR is related to issue:
223
-
- Link to documentation pull request:
224
-
- Link to developer documentation pull request:
225
-
- Link to frontend pull request:
193
+
Strip out all HTML comments (`<!-- ... -->`) from the template, then fill in the sections:
226
194
227
-
## Checklist
228
-
229
-
-[ ] I understand the code I am submitting and can explain how it works.
230
-
-[{tested_checkbox}] The code change is tested and works locally.
231
-
-[{tests_pass_checkbox}] Local tests pass. **Your PR cannot be merged unless tests pass**
232
-
-[{no_comments_checkbox}] There is no commented out code in this PR.
233
-
-[{dev_checklist_checkbox}] I have followed the [development checklist][dev-checklist]
234
-
-[{perfect_pr_checkbox}] I have followed the [perfect PR recommendations][perfect-pr]
235
-
-[{ruff_checkbox}] The code has been formatted using Ruff (`ruff format homeassistant tests`)
236
-
-[{tests_added_checkbox}] Tests have been added to verify that the new code works.
237
-
-[ ] Any generated code has been carefully reviewed for correctness and compliance with project standards.
238
-
239
-
If user exposed functionality or configuration variables are added/changed:
240
-
241
-
-[{docs_checkbox}] Documentation added/updated for [www.home-assistant.io][docs-repository]
242
-
243
-
If the code communicates with devices, web services, or third-party tools:
244
-
245
-
-[{manifest_checkbox}] The [manifest file][manifest-docs] has all fields filled out correctly.
246
-
Updated and included derived files by running: `python3 -m script.hassfest`.
247
-
-[{requirements_checkbox}] New or updated dependencies have been added to `requirements_all.txt`.
248
-
Updated by running `python3 -m script.gen_requirements_all`.
249
-
-[{changelog_checkbox}] For the updated dependencies - a link to the changelog, or at minimum a diff between library versions is added to the PR description.
250
-
251
-
To help with the load of incoming pull requests:
252
-
253
-
-[ ] I have reviewed two other [open pull requests][prs] in this repository.
1.**Breaking change section**: If the type is NOT "Breaking change" or "Deprecation", remove the entire `## Breaking change` section (heading and body). Otherwise, describe what breaks, how users can fix it, and why.
196
+
2.**Proposed change section**: Fill in a description of the change extracted from commit messages.
197
+
3.**Type of change**: Check exactly ONE checkbox matching the determined type from Step 6. Leave all others unchecked.
198
+
4.**Additional information**: Fill in any related issue numbers if known.
199
+
5.**Checklist**: Check boxes based on the verification results from Steps 3-5 and the conditions in Step 7.
262
200
263
-
**Note:**Replace each `{*_checkbox}` placeholder with `x` if the condition passed, or `` (space) if it did not. This applies to both the "Type of change" checkboxes (only one should be `x`) and the "Checklist" checkboxes (multiple can be `x` based on verification results).
201
+
**Important:**Preserve all template structure, options, and link references exactly as they appear in the file — only modify checkbox states and fill in content sections.
0 commit comments