Skip to content
New issue

Have a question about this project? Sign up for a free GitHub account to open an issue and contact its maintainers and the community.

By clicking “Sign up for GitHub”, you agree to our terms of service and privacy statement. We’ll occasionally send you account related emails.

Already on GitHub? Sign in to your account

Strict unmarshal for plugin files #3046

Merged
merged 1 commit into from
Jan 3, 2025
Merged

Conversation

bjw-s
Copy link
Contributor

@bjw-s bjw-s commented Dec 29, 2024

This PR aims to improve the behaviour introduced in #2770.

The regular Unmarshal function does not result in an err when trying to unmarshal a yaml file that contains a plugins key into a Plugin var. The UnmarshalStrict function will, since it finds the undefined plugins key, causing the next loop to actually trigger.

I have also taken the liberty to make it look for plugins in the XDG_DATA_HOME and XDG_CONFIG_HOME folders. This is especially useful since XDG_DATA_HOME is not included in the XDG_DATA_DIRS by default (as per https://specifications.freedesktop.org/basedir-spec/latest/#variables). This allows users to define per-user plugins in addition to the ones in /usr/local/share/:/usr/share/.

Copy link
Owner

@derailed derailed left a comment

Choose a reason for hiding this comment

The reason will be displayed to describe this comment to others. Learn more.

@bjw-s Thank you for this update!

@derailed derailed merged commit 356a09d into derailed:master Jan 3, 2025
2 checks passed
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