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

Add a check for config file extension before loading #50

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

Conversation

j6k4m8
Copy link
Member

@j6k4m8 j6k4m8 commented Jan 13, 2025

Describe your changes

This PR adds a check (per #47) that ensures the config file path ends with .yaml.

Was thinking about adding a action=... class to the argument, but feels like overkill and this is much more readable. Feedback welcome if you prefer that technique!

Issue Link

Closes #47

Type of change

  • 🐛 Bug fix (non-breaking change that fixes an issue)
  • ✨ New feature (non-breaking change that adds functionality)
  • 💥 Breaking change (fix or feature that would cause existing functionality to not work as expected)
  • 📖 Documentation (Addition or improvements to documentation)

Checklist before requesting a review

  • My branch is up-to-date with the target branch - if not update your fork with the changes from the target branch (use pull with --rebase option if possible).
  • I have performed a self-review of my code
  • For any new/modified functions/classes I have added docstrings that clearly describe its purpose, expected inputs and returned values
  • I have placed in-line comments to clarify the intent of any hard-to-understand passages of my code
  • I have updated the documentation to cover introduced code changes
  • I have added tests that prove my fix is effective or that my feature works
  • I have given the PR a name that clearly describes the change, written in imperative form (context).
  • I have requested a reviewer and an assignee (assignee is responsible for merging)

Checklist for reviewers

Each PR comes with its own improvements and flaws. The reviewer should check the following:

  • the code is readable
  • the code is well tested
  • the code is documented (including return types and parameters)
  • the code is easy to maintain

Author checklist after completed review

  • I have added a line to the CHANGELOG describing this change, in a section
    reflecting type of change (add section where missing):
    • added: when you have added new functionality
    • changed: when default behaviour of the code has been changed
    • fixes: when your contribution fixes a bug

Checklist for assignee

  • PR is up to date with the base branch
  • the tests pass
  • author has added an entry to the changelog (and designated the change as added, changed or fixed)
  • Once the PR is ready to be merged, squash commits and merge the PR.

@leifdenby
Copy link
Member

sorry for the delay @j6k4m8 - I was off ill for a while... 😞

All the tests pass now :) Do you want to update the changelog and we can get this merged in? Remember to add yourself to the list of contributors in pyproject.toml too

@leifdenby
Copy link
Member

It's probably fair to call this a bug I think. I would be reasonable to assume that the application supports reading both .yaml and .yml when I state that we're using "yaml" files. But with your fix only supporting .yaml is now "expected behaviour" 😄

@leifdenby leifdenby added the bug Something isn't working label Jan 28, 2025
@j6k4m8
Copy link
Member Author

j6k4m8 commented Jan 28, 2025

I'd (very gently) agree that this is a bug, but I think reasonable to just enforce .yaml for now; it's an easy enough fix and I can't imagine a circumstance where someone can't rename a yml file... But of course, happy to add support for yml if you prefer!

PS: hope you're feeling better :)

Sign up for free to join this conversation on GitHub. Already have an account? Sign in to comment
Labels
bug Something isn't working
Projects
None yet
Development

Successfully merging this pull request may close these issues.

Should specify somewhere that the datastore.yaml needs yAML, not yml suffix
2 participants