chore: audit cleanup (WSL fixes, hatch-vcs, ruff, CI, release-please)#1
Merged
Conversation
… 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.
This file contains hidden or bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
Sign up for free
to join this conversation on GitHub.
Already have an account?
Sign in to comment
Add this suggestion to a batch that can be applied as a single commit.This suggestion is invalid because no changes were made to the code.Suggestions cannot be applied while the pull request is closed.Suggestions cannot be applied while viewing a subset of changes.Only one suggestion per line can be applied in a batch.Add this suggestion to a batch that can be applied as a single commit.Applying suggestions on deleted lines is not supported.You must change the existing code in this line in order to create a valid suggestion.Outdated suggestions cannot be applied.This suggestion has been applied or marked resolved.Suggestions cannot be applied from pending reviews.Suggestions cannot be applied on multi-line comments.Suggestions cannot be applied while the pull request is queued to merge.Suggestion cannot be applied right now. Please check back later.
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
fix:build:[project.urls]feat:python -m dcodechore:ci:ci:docs:chore:Behavioral changes
settings.jsonis now patched in place; comments and trailing commas survive. The previous version silently destroyed them.dev.containers.executeInWSLDistrois now correctly added even whendev.containers.executeInWSLis alreadytrue(was a bug).code/code-insidersare now propagated. Previously they were silently swallowed.devcontainer.jsonproduces a friendly stderr message and falls back to the default workspace folder, instead of crashing.Operational notes (post-merge)
mainafter 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.v0.4.1already exists onmain(pushed earlier as the hatch-vcs baseline).Verification
uv run pytest)uv run ruff check)uv buildproduces a wheel with hatch-vcs-resolved versionpython -m dcode --helpworks