fix: handle missing config file gracefully (no more crash on first run)#35
Open
DrGalio wants to merge 1 commit intoApexOpsStudio:mainfrom
Open
fix: handle missing config file gracefully (no more crash on first run)#35DrGalio wants to merge 1 commit intoApexOpsStudio:mainfrom
DrGalio wants to merge 1 commit intoApexOpsStudio:mainfrom
Conversation
07361fb to
af8ffc5
Compare
When ~/.config/task-cli/config.yaml doesn't exist, load_config() now creates a default config file instead of crashing with FileNotFoundError. Changes: - load_config() creates default config if missing - Wired load_config() into main() so config is loaded on startup - Added tests for missing config and existing config scenarios Fixes ApexOpsStudio#2
af8ffc5 to
8394f53
Compare
This file contains hidden or bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
Sign up for free
to join this conversation on GitHub.
Already have an account?
Sign in to comment
Add this suggestion to a batch that can be applied as a single commit.This suggestion is invalid because no changes were made to the code.Suggestions cannot be applied while the pull request is closed.Suggestions cannot be applied while viewing a subset of changes.Only one suggestion per line can be applied in a batch.Add this suggestion to a batch that can be applied as a single commit.Applying suggestions on deleted lines is not supported.You must change the existing code in this line in order to create a valid suggestion.Outdated suggestions cannot be applied.This suggestion has been applied or marked resolved.Suggestions cannot be applied from pending reviews.Suggestions cannot be applied on multi-line comments.Suggestions cannot be applied while the pull request is queued to merge.Suggestion cannot be applied right now. Please check back later.
Summary
Fixes the
FileNotFoundErrorcrash when~/.config/task-cli/config.yamlis missing. The CLI now creates a sensible default config on first run.Changes
task.py:load_config()now:~/.config/task-cli/directory if missingconfig.yamlif the file doesn't existtest_task.py: Added 3 new tests:test_load_config_creates_default_when_missing— verifies default config is created when file is absenttest_load_config_reads_existing_file— verifies existing files are read correctlytest_load_config_handles_missing_entire_config_dir— verifies full missing-directory scenario.gitignore: Added Python cache exclusionsAcceptance Criteria
Verification