Skip to content

feat: display syntax errors for settings and workflow config#1278

Open
atharva-deopujari wants to merge 1 commit into
anthropics:mainfrom
atharva-deopujari:feat/config-syntax-error-display
Open

feat: display syntax errors for settings and workflow config#1278
atharva-deopujari wants to merge 1 commit into
anthropics:mainfrom
atharva-deopujari:feat/config-syntax-error-display

Conversation

@atharva-deopujari
Copy link
Copy Markdown

Summary

Syntax errors in .claude/settings.json and workflow inputs like allowed_tools are currently silently ignored, making debugging difficult for users. This adds clear error messages when configuration has issues.

Changes

base-action/src/setup-claude-code-settings.ts

  • Surface JSON parse errors with the specific syntax error message when .claude/settings.json or the settings input contains invalid JSON
  • Use core.warning() for recoverable issues (corrupt existing file) and core.error() for blocking issues (bad input)

base-action/src/parse-sdk-options.ts

  • Detect YAML list markers (- prefixes) in allowed_tools / disallowed_tools entries, a common mistake when using pipe (|) notation in workflow YAML
  • Emit core.warning() with a corrective example and strip the markers so tools still work

Tests

  • 3 new tests for settings JSON validation
  • 4 new tests for YAML marker detection

All 42 tests pass. Typecheck clean.

Fixes #242

@atharva-deopujari
Copy link
Copy Markdown
Author

Closing - looks like this has already been addressed. Thanks!

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.

Feature Request: Display syntax errors for .claude/setting.json and GitHub Actions workflows

1 participant