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

feat: improve toml validation #248

Open
wants to merge 5 commits into
base: main
Choose a base branch
from

Conversation

beeb
Copy link
Collaborator

@beeb beeb commented Feb 13, 2025

This PR improves the TOML validation when reading dependencies from the config file. Extraneous fields now generate an error.

Closes #219

beeb added 5 commits February 5, 2025 22:58
feat: add logging to update module

refactor: remove useless utility to read a file

feat: add logging to utils

feat: verbose flag

feat: support RUST_LOG

fix: disable tui
Also improve error for url conflict (http url and git both present)
@beeb beeb self-assigned this Feb 13, 2025
@@ -859,6 +859,13 @@ fn parse_dependency(name: impl Into<String>, value: &Item) -> Result<Dependency>
}
};

// check for unallowed fields
if let Some((k, _)) =
table.iter().find(|(k, _)| !["version", "url", "git", "rev", "branch", "tag"].contains(k))
Copy link
Owner

Choose a reason for hiding this comment

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

instead of reverting, i would just throw a warning saying this field is not supported. in this way if someone wants extra fields so be it

Copy link
Collaborator Author

Choose a reason for hiding this comment

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

Makes sense, will do!

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.

Stricter validation when parsing dependencies
2 participants