Skip to content

chore: audit cleanup (WSL fixes, hatch-vcs, ruff, CI, release-please)#1

Merged
rosstaco merged 8 commits into
mainfrom
chore/audit-cleanup
Apr 27, 2026
Merged

chore: audit cleanup (WSL fixes, hatch-vcs, ruff, CI, release-please)#1
rosstaco merged 8 commits into
mainfrom
chore/audit-cleanup

Conversation

@rosstaco
Copy link
Copy Markdown
Owner

Addresses audit findings from the recent code review. See project/plans/2026-04-27-audit-cleanup/plan.md for full context.

What's in here

Commit Type Summary
fix: bug WSL settings JSONC preservation, executeInWSLDistro skip bug, devcontainer.json error handling, exit-code propagation
build: infra Switch to hatch-vcs (version derived from git tags), add [project.urls]
feat: feature Support python -m dcode
chore: tooling Add ruff configuration
ci: infra CI workflow (py3.11/3.12/3.13)
ci: infra release-please workflow
docs: docs README WSL section + copilot-instructions update
chore: docs Planning artifacts

Behavioral changes

  • WSL users: settings.json is now patched in place; comments and trailing commas survive. The previous version silently destroyed them.
  • WSL users with stale config: dev.containers.executeInWSLDistro is now correctly added even when dev.containers.executeInWSL is already true (was a bug).
  • Anyone: non-zero exit codes from code/code-insiders are now propagated. Previously they were silently swallowed.
  • Anyone: malformed devcontainer.json produces a friendly stderr message and falls back to the default workspace folder, instead of crashing.

Operational notes (post-merge)

  1. First commit on main after merge must be a Conventional Commit (feat:, fix:, etc.) for release-please to open its first release PR. The 8 commits in this PR will themselves trigger that PR.
  2. Repo settings: enable Settings → Actions → General → "Allow GitHub Actions to create and approve pull requests" (required for release-please).
  3. Tag v0.4.1 already exists on main (pushed earlier as the hatch-vcs baseline).

Verification

… exit codes

- Replace destructive json.dumps rewrite of Windows VS Code settings.json with a regex-based in-place patcher (_patch_jsonc_settings) that preserves comments and trailing commas.

- Fix bug where dev.containers.executeInWSLDistro was never set when executeInWSL was already true.

- Fall back to printing a hint instead of corrupting un-patchable settings files.

- get_workspace_folder now reports a friendly error and uses the default workspace folder when devcontainer.json is unparseable.

- run_dcode now propagates non-zero exit codes from the code/code-insiders launcher via sys.exit.

- _wsl_to_windows_path checks subprocess returncode before using stdout.

- Narrow except Exception to (OSError, ValueError) in WSL settings parse.
- Switch to hatch-vcs so the version comes from the latest git tag at build time.

- __init__.py exposes __version__ via importlib.metadata.version, with a PackageNotFoundError fallback.

- Add [project.urls] (Homepage/Issues/Source).

- Add ruff to dev dependencies.

- Gitignore generated _version.py and .ruff_cache/.
Line-length 100, target py311, lint rules E/F/I/UP/B/SIM.
Matrix py3.11/3.12/3.13. Uses fetch-depth: 0 so hatch-vcs can resolve the version from git tags.
Uses release-type: simple so it manages only the manifest, tag, and CHANGELOG. hatch-vcs reads the tag for the actual package version, so no source files need to be edited.
- Add WSL behavior section to README explaining the settings.json auto-edit and how to opt out.

- Note Conventional Commits requirement and the release-please flow.

- Update copilot-instructions to remove the manual version-bump rule (now handled by hatch-vcs + release-please).
Plan, implementation notes, and verification report for this change.
@rosstaco rosstaco merged commit 9931e6b into main Apr 27, 2026
3 checks passed
Sign up for free to join this conversation on GitHub. Already have an account? Sign in to comment

Labels

None yet

Projects

None yet

Development

Successfully merging this pull request may close these issues.

1 participant