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

Strictly enforce no unused keys in yaml #996

Merged
merged 1 commit into from
Feb 5, 2025

Conversation

rayg1234
Copy link
Collaborator

@rayg1234 rayg1234 commented Feb 5, 2025

This enforces config yamls to have no unused keys. The only allowed top-level keys now are {"job", "runner"} and keys that are used in variable replacements.
ie: (dataloader: ...) is allowed as long as the yaml references ${dataloader} somewhere.

OK Config:

replacement_value: 5
job: ...
runner:
  x: ${replacement_value}

NOT OK Config:

random_key: 5
job: ...
runner:
  x: 10

@rayg1234 rayg1234 added enhancement New feature or request minor Minor version release labels Feb 5, 2025
@rayg1234 rayg1234 requested a review from lbluque February 5, 2025 00:20
Copy link
Collaborator

@lbluque lbluque left a comment

Choose a reason for hiding this comment

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

lgtm

Copy link

codecov bot commented Feb 5, 2025

Codecov Report

Attention: Patch coverage is 96.66667% with 1 line in your changes missing coverage. Please review.

Files with missing lines Patch % Lines
src/fairchem/core/_cli_hydra.py 96.42% 1 Missing ⚠️
Files with missing lines Coverage Δ
src/fairchem/core/components/runner.py 80.00% <100.00%> (+0.58%) ⬆️
src/fairchem/core/_cli_hydra.py 86.36% <96.42%> (+2.87%) ⬆️

@rayg1234 rayg1234 added this pull request to the merge queue Feb 5, 2025
Merged via the queue into main with commit 3f91076 Feb 5, 2025
8 of 10 checks passed
Sign up for free to join this conversation on GitHub. Already have an account? Sign in to comment
Labels
enhancement New feature or request minor Minor version release
Projects
None yet
Development

Successfully merging this pull request may close these issues.

2 participants