Skip to content

feat(config): use toml for configuring zizmor#1666

Draft
reubenwong97 wants to merge 1 commit into
zizmorcore:mainfrom
reubenwong97:feature/toml-config
Draft

feat(config): use toml for configuring zizmor#1666
reubenwong97 wants to merge 1 commit into
zizmorcore:mainfrom
reubenwong97:feature/toml-config

Conversation

@reubenwong97

@reubenwong97 reubenwong97 commented Feb 26, 2026

Copy link
Copy Markdown
Contributor

Pre-submission checks

Please check these boxes:

  • Mandatory: This PR corresponds to an issue: Switch to TOML for zizmor's config #1560 .

  • I hereby disclose the use of an LLM or other AI coding assistant in the
    creation of this PR. PRs will not be rejected for using AI tools, but
    will be rejected for undisclosed use.

If a checkbox is not applicable, you can leave it unchecked.

Summary

This PR is currently a DRAFT for the purposes of obtaining feedback.

The changes are broadly:

  • Introduction of a ConfigFormat enum so that the appropriate deserializer is called.
  • Updates of signatures of load to accept ConfigFormat
  • Use of serde_json::Value as the intermediate representation. This was chosen since its variants could be produced by yaml or toml configs in zizmor (as opposed to serde_yaml::Value which has Tagged variants for example).
  • Removal of ForbiddenUsesConfigInner, the change to serde_json removed keys being deserialized as yaml tags from being an issue.
  • Additional error variants for ConfigErrorInner::Syntax since it could be due to a toml or serde_yaml deserialization error.

TODO:

[ ] Migration from yaml config to toml

Test Plan

I've so far tested dummy configs (yaml and toml) against the coreutils workflows and managed to obtain the same results. When the approach is more set in stone, I will add some tests.

@reubenwong97

Copy link
Copy Markdown
Contributor Author

Hi @woodruffw ,

I have a first draft of the change to use TOML configs here. Could you help to take a quick look when you have time? I'm not the most confident in these changes, primarily due to introducing an extra ConfigFormat that needs to be passed into load call-sites, as well as the error variants and use of serde_json::Value as the intermediate type that yaml and toml can deserialize into.

Thanks a lot!

Best,
Reuben

@woodruffw

Copy link
Copy Markdown
Member

Thanks @reubenwong97, I'll try and give this a review in the coming days! My time for the next few days is somewhat limited, so it might take me a bit.

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.

2 participants