Skip to content

fix: improve YAML formatting and resolve gosec lint warnings#219

Merged
indaco merged 2 commits intomainfrom
fix/yaml-formatting-and-gosec-warnings
Mar 8, 2026
Merged

fix: improve YAML formatting and resolve gosec lint warnings#219
indaco merged 2 commits intomainfrom
fix/yaml-formatting-and-gosec-warnings

Conversation

@indaco
Copy link
Copy Markdown
Owner

@indaco indaco commented Mar 8, 2026

Description

Fix YAML output formatting when generating .sley.yaml via sley init and resolve gosec lint warnings.

YAML formatting:

Replace yaml.Marshal with yaml.MarshalWithOptions(..., yaml.Indent(2), yaml.IndentSequence(true)) so that YAML sequences (e.g. files under dependency-check) are properly indented:

  # before                     # after
  files:                       files:
  - path: package.json           - path: package.json
    field: version                 field: version

Gosec fixes:

  • G122 (workspace.go): Use os.OpenRoot for symlink-safe file reads inside WalkDir callback
  • G703 (updater.go, generator.go): Suppress path traversal taint warnings for internally-resolved config/changelog paths
  • G118 (error_recovery_test.go, executor_test.go): Add defer cancel() for context cancellation

Related Issue

  • None

Notes for Reviewers

  • None

@indaco indaco self-assigned this Mar 8, 2026
@indaco indaco merged commit da914d5 into main Mar 8, 2026
7 checks passed
@indaco indaco deleted the fix/yaml-formatting-and-gosec-warnings branch March 8, 2026 22:16
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