Follow-up cleanup items spotted during review of #87 (merge 5ddf6a3, upstream v0.13.0 sync). Both are non-blocking; filing as one issue since they are tiny and share the same origin.
1. _require_https should reuse the hostname local
File: src/specify_cli/commands/bundle/__init__.py:829
After the ValueError guard was added, the final host-check re-accesses parsed.hostname instead of reusing the hostname local captured in the try block:
try:
parsed = urlparse(url)
hostname = parsed.hostname
except ValueError:
raise BundlerError(...) from None
is_localhost = hostname in ("localhost", "127.0.0.1", "::1")
...
if not parsed.hostname: # <- should be `not hostname`
raise BundlerError(f"Refusing to download {label} from URL with no host: {url}")
Not a bug (ParseResult is immutable for a given URL, so a successful first access won't raise on re-access), but inconsistent with the sibling fix in src/specify_cli/presets/__init__.py:2093, which uses the hostname local consistently. Mirror that pattern here to prevent drift in future refactors.
Fix: one-line change - if not parsed.hostname: -> if not hostname:.
2. Markdown blank lines in new extensions section
File: docs/reference/extensions.md
The new "Project Extension and Hook Configuration" section runs paragraphs directly into closing code fences and table rows:
- Line 180-181: closing
``` immediately followed by paragraph text
- Line 227-228: closing table row immediately followed by paragraph text
Most renderers tolerate this, but CommonMark may treat the run-together text as a block continuation in some cases. Add a blank line in both spots.
Acceptance
Context
Follow-up cleanup items spotted during review of #87 (merge
5ddf6a3, upstream v0.13.0 sync). Both are non-blocking; filing as one issue since they are tiny and share the same origin.1.
_require_httpsshould reuse thehostnamelocalFile:
src/specify_cli/commands/bundle/__init__.py:829After the
ValueErrorguard was added, the final host-check re-accessesparsed.hostnameinstead of reusing thehostnamelocal captured in the try block:Not a bug (
ParseResultis immutable for a given URL, so a successful first access won't raise on re-access), but inconsistent with the sibling fix insrc/specify_cli/presets/__init__.py:2093, which uses thehostnamelocal consistently. Mirror that pattern here to prevent drift in future refactors.Fix: one-line change -
if not parsed.hostname:->if not hostname:.2. Markdown blank lines in new extensions section
File:
docs/reference/extensions.mdThe new "Project Extension and Hook Configuration" section runs paragraphs directly into closing code fences and table rows:
```immediately followed by paragraph textMost renderers tolerate this, but CommonMark may treat the run-together text as a block continuation in some cases. Add a blank line in both spots.
Acceptance
src/specify_cli/commands/bundle/__init__.py:829useshostnamelocaldocs/reference/extensions.mdhas blank lines after the closing fence (line 180) and after the hook-fields table (line 227)uv sync --extra test && .venv/bin/python -m pytest tests/commands/bundle/ tests/test_workflows.py -qContext
github/spec-kitv0.13.0