Harden config-dir check-ignore and trim docstrings#1725
Conversation
Pass `--` to `git check-ignore` so a config_dir starting with `-` is read as a path, not an option; trim the helper and test docstrings to terse contracts per the repo style.
Codecov Report✅ All modified and coverable lines are covered by tests. Additional details and impacted files@@ Coverage Diff @@
## main #1725 +/- ##
=======================================
Coverage 99.54% 99.54%
=======================================
Files 227 227
Lines 18174 18174
=======================================
Hits 18092 18092
Misses 82 82
Flags with carried forward coverage won't be shown. Click here to find out more.
🚀 New features to boost your workflow:
|
PR Review — Harden config-dir check-ignore and trim docstringsClean, correctly-scoped maintenance follow-up. Merge-ready.
Checklist
Automated review by Kōan (Claude) |
esphbot
left a comment
There was a problem hiding this comment.
No blocking issues found.
There was a problem hiding this comment.
Pull request overview
This PR tightens a small edge case in the version-history “enclosing git repo adoption” logic by ensuring git check-ignore treats the config directory as a path even when it begins with -, and aligns docstrings with the repo’s terse contract style.
Changes:
- Pass
--togit check-ignorein_enclosing_repo_ignores_config_dirto prevent option injection/misparse for leading-dash config dir paths. - Trim docstrings in the helper and its test to match the repo’s “terse contracts” docstring convention.
Reviewed changes
Copilot reviewed 2 out of 2 changed files in this pull request and generated 1 comment.
| File | Description |
|---|---|
esphome_device_builder/controllers/version_history/git_repo.py |
Harden git check-ignore invocation with -- and shorten the helper docstring. |
tests/controllers/version_history/test_git_repo.py |
Shorten the test docstring to a single-line contract. |
What does this implement/fix?
Addresses a late Copilot review on #1720 (it landed seconds after merge). Two small things in the version-history git adoption code; no behaviour change for normal config dirs.
Pass
--togit check-ignorein_enclosing_repo_ignores_config_dirso aconfig_dirwhose path begins with-is read as a path rather than an option. Trim the helper docstring and the new test's docstring to terse contracts per the repo style (drop the rationale block and the issue-number cross-reference; the why lives in #1720 and its commit).Related issue or feature (if applicable):
Types of changes
bugfixnew-featureenhancementbreaking-changerefactordocsmaintenancecidependenciesFrontend coordination
Checklist
ruff,codespell, yaml/json/python checks).tests/where applicable.components.index.json/definitions/components/*.jsonhave not been hand-edited (regenerate viascript/sync_components.pyif a sync is needed).docs/ARCHITECTURE.mdand/ordocs/API.md.