From 883d827d45330e8c1850e880acdab1121f08060f Mon Sep 17 00:00:00 2001 From: Manuel Alejandro de Brito Fontes Date: Tue, 25 Aug 2026 10:22:39 -0300 Subject: [PATCH 1/3] Apply suggested fix to internal/templates/apply.go from Copilot Autofix Co-authored-by: Copilot Autofix powered by AI <223894421+github-code-quality[bot]@users.noreply.github.com> Signed-off-by: Manuel Alejandro de Brito Fontes --- internal/templates/apply.go | 6 +++++- 1 file changed, 5 insertions(+), 1 deletion(-) diff --git a/internal/templates/apply.go b/internal/templates/apply.go index 2c31d1d..780dfc9 100644 --- a/internal/templates/apply.go +++ b/internal/templates/apply.go @@ -262,8 +262,12 @@ func applyOptionDefaults(fsys pfs.FS, extractDir string, userOptions map[string] if err != nil { return merged } + standardized, err := hujson.Standardize(data) + if err != nil { + return merged + } var meta TemplateMetadata - if err := json.Unmarshal(data, &meta); err != nil { + if err := json.Unmarshal(standardized, &meta); err != nil { return merged } for key, raw := range meta.Options { From 0486d3dd4fbacd94b6c651fd4b9efe4d5c0e62b4 Mon Sep 17 00:00:00 2001 From: Manuel Alejandro de Brito Fontes Date: Tue, 25 Aug 2026 10:22:40 -0300 Subject: [PATCH 2/3] Apply suggested fix to internal/templates/apply.go from Copilot Autofix Co-authored-by: Copilot Autofix powered by AI <223894421+github-code-quality[bot]@users.noreply.github.com> Signed-off-by: Manuel Alejandro de Brito Fontes --- internal/templates/apply.go | 4 +++- 1 file changed, 3 insertions(+), 1 deletion(-) diff --git a/internal/templates/apply.go b/internal/templates/apply.go index 780dfc9..c0089e4 100644 --- a/internal/templates/apply.go +++ b/internal/templates/apply.go @@ -191,7 +191,9 @@ func mergeFeatures(fsys pfs.FS, workspaceFolder string, featureOpts []TemplateFe return fmt.Errorf("parse %s: %w", configPath, stdErr) } var config map[string]json.RawMessage - json.Unmarshal(stdData, &config) + if err := json.Unmarshal(stdData, &config); err != nil { + return fmt.Errorf("unmarshal %s: %w", configPath, err) + } existing := map[string]bool{} _, hasFeatures := config["features"] if hasFeatures { From 838ad85b5096e27ad8ff741fc84bc4c44c112acb Mon Sep 17 00:00:00 2001 From: Manuel Alejandro de Brito Fontes Date: Tue, 25 Aug 2026 10:22:41 -0300 Subject: [PATCH 3/3] Apply suggested fix to internal/templates/apply.go from Copilot Autofix Co-authored-by: Copilot Autofix powered by AI <223894421+github-code-quality[bot]@users.noreply.github.com> Signed-off-by: Manuel Alejandro de Brito Fontes --- internal/templates/apply.go | 9 +++++++-- 1 file changed, 7 insertions(+), 2 deletions(-) diff --git a/internal/templates/apply.go b/internal/templates/apply.go index c0089e4..755785a 100644 --- a/internal/templates/apply.go +++ b/internal/templates/apply.go @@ -62,10 +62,15 @@ func FetchAndApply(params ApplyParams, selected SelectedTemplate) ([]string, err // Extract to temp dir tmpDir := params.TmpDir + var extractDir string if tmpDir == "" { - tmpDir = os.TempDir() + extractDir, err = os.MkdirTemp("", "devcontainer-template-") + if err != nil { + return nil, fmt.Errorf("create extract dir: %w", err) + } + } else { + extractDir = filepath.Join(tmpDir, "template-"+ref.ID) } - extractDir := filepath.Join(tmpDir, "template-"+ref.ID) if err := fsys.MkdirAll(extractDir); err != nil { return nil, fmt.Errorf("create extract dir: %w", err) }