Repository navigation
fix: parse-error crash, and upgrade to latest VS Code API + Node LTS - #90
Merged
Merged
Conversation
hadolint reports Dockerfile parse errors as
<file>:<line>:<column> <message>
with no rule code. The rule-violation pattern matched these too, taking
the column as the line number and the first word of the message as the
rule id. getRuleUrl then threw on that bogus id, and since it is called
while building diagnostics, a single parse error aborted the entire lint
run and surfaced as "expecting is not a supported rule".
Match parse errors explicitly, return null from getRuleUrl instead of
throwing, and guard the two nearby crash paths: results may be null for
unparseable output, and hadolint can report a line past the end of the
buffer while the user is still typing.
Also fixes two defects found alongside:
- the level switch had no break statements, so an error-level message
raised the error, info and warning popups at once
- `result !== (undefined || null || "")` short-circuits to `""`, so the
undefined and null checks never did anything
Adds unit tests covering both functions; they fail against the previous
implementation.
Closes #89
Closes #60
Co-Authored-By: Claude Opus 4.8 (1M context) <noreply@anthropic.com>
Claude-Session: https://claude.ai/code/session_01Ndc9cNqeRHHsXDDKuzEmom
- typescript 4.5 -> 7.0
- vscode-languageclient/server 8 -> 10
- @types/vscode 1.69 -> 1.125, engines.vscode ^1.70 -> ^1.125
- node pinned to 24.18.0 (Krypton LTS), engines.node >=22
- mocha 8 -> 11, @types/mocha 5 -> 10
- esbuild, rimraf, glob, which, cross-spawn to latest
- vsce -> @vscode/vsce, vscode-test -> @vscode/test-electron
- rome (abandoned) -> @biomejs/biome
Vulnerabilities drop from 18 (1 critical) to 3, all dev-only.
API changes this forced:
- vscode-languageclient 10 requires a LogOutputChannel, so the output
channel is created with {log: true}. It gains log levels and
timestamps, and info-level lines may be filtered by default.
- glob 9 dropped the callback API, so the test harness uses globSync.
- mocha 11 renamed the useColors option to color.
TypeScript 7 enables `strict` by default. This project has never
compiled under strict, so it is switched off explicitly to keep this an
upgrade rather than a rewrite; enabling it is worth doing separately.
CI had rotted well past the rome reference: ::set-output was disabled by
GitHub in 2023 and checkout@v2/setup-node@v2 use removed runtimes, so
the workflow could not have been running. Modernized, pinned to Node 24,
and macOS now installs hadolint via Homebrew because the workflow was
fetching a Darwin-x86_64 binary onto arm64 runners.
Removes the Travis CI and Greenkeeper badges; both services are defunct
and vsce 3 refuses to package with SVG badges.
Co-Authored-By: Claude Opus 4.8 (1M context) <noreply@anthropic.com>
Claude-Session: https://claude.ai/code/session_01Ndc9cNqeRHHsXDDKuzEmom
Mechanical reformat of the files not otherwise touched by this branch. Biome is configured to match the existing rome style (tabs, double quotes, no bracket spacing) to keep the diff to a minimum. Co-Authored-By: Claude Opus 4.8 (1M context) <noreply@anthropic.com> Claude-Session: https://claude.ai/code/session_01Ndc9cNqeRHHsXDDKuzEmom
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.
Fixes the "
<word>is not a supported rule" crash, then brings the toolchain current.Three commits, reviewable independently:
fix:the crash + regression tests — closes hadolint: unexpected is not a supported rule #89, closes Weird error: "expecting is not a supported rule" #60chore:dependency upgrade + CI modernizationstyle:biome reformat sweep (mechanical)The bug
hadolint reports Dockerfile parse errors as
<file>:<line>:<column> <message>, with no rule code. The rule-violation regex matched those too, taking the column as the line number and the first word of the message as the rule id.getRuleUrlthen threw on that bogus id — and it's called inside the diagnostic loop, so one parse error aborted the whole lint run and surfaced as a popup.Reproduced on hadolint 2.14.0 with a two-line Dockerfile, and verified fixed in the Extension Development Host: diagnostic now reads
[hadolint] expecting the workdir path [Ln 2, Col 1]with no popup.Two more defects found alongside:
switchhad nobreakstatements, so an error-level message raised the error, info and warning popups at once.result !== (undefined || null || "")short-circuits to""— the undefined/null checks never did anything.Upgrade
TypeScript 4.5→7.0 · vscode-languageclient/server 8→10 · @types/vscode 1.69→1.125 · Node pinned to 24.18.0 (Krypton LTS) · mocha 8→11 · esbuild/rimraf/glob/which/cross-spawn latest ·
vsce→@vscode/vsce·vscode-test→@vscode/test-electron·rome(abandoned)→@biomejs/biome.Vulnerabilities: 18 (1 critical) → 3, all dev-only.
On the #79 revert
#79 was reverted because
@vscode/test-electron"broke the integration test (or made it flaky)". Both VS Code builds now sit side by side in.vscode-test/:vscode-test@1.5.2predates Apple Silicon and pulls the x86_64 build, running VS Code under Rosetta. So the package that was reverted looks like the one that fixes the flakiness — though in Jan 2023 arm64 support was newer and rougher, so that failure was real at the time. Caveat: this is inference from the download URLs on one machine, not a reproduced flake.Verification
biome checkclean ·tsc -bclean · 9/9 unit · e2e green 3 runs in a row · vsix packages (9 files, nothing leaked).Notes for review
strict: falseis now explicit. TS 7 enablesstrictby default; this project has never compiled under it. Kept off so this stays an upgrade, not a rewrite — worth its own PR.LogOutputChannel(languageclient 10 requires it). User-visible: gains log levels/timestamps, and info-level lines may be filtered by default.::set-outputwas disabled by GitHub in 2023 andcheckout@v2/setup-node@v2use removed runtimes, so it could not have been running. Also switched macOS tobrew install hadolint, since it was fetching a Darwin-x86_64 binary onto arm64 runners.vsce@3refuses to package with SVG badges.🤖 Generated with Claude Code
https://claude.ai/code/session_01Ndc9cNqeRHHsXDDKuzEmom