Repository navigation
Conversation
Author
|
Hi @schettino72, could you take a look at this when you have a moment? Happy to fix up anything that needs changing. Thanks! |
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.
Fixes #478 and #469.
#478 —
doit forgetcrashes when nodefault_tasksare configured. With no task names on the command line and nodefault_tasks,Forget._executeiterated overself.sel_tasks, which isNonein that case, raisingTypeError: 'NoneType' object is not iterable.runandcleanalready treat "nothing selected" as "all tasks" (cleancheckssel_tasks is not Noneexplicitly), soforgetnow does the same: it forgets every task. The collected list is de-duplicated, since a list built from all tasks contains group subtasks twice (once directly, once via the group), and dependencies shared by several selected tasks would otherwise be forgotten (and reported) repeatedly.#469 —
default_tasksset via config file /DoitMain(extra_config=...)was ignored byforget.default_tasksis not a registered command option, so values inDoitMain's config (extra_configor INI/TOML files, both available asself.config_vals) were silently dropped by the option parser; onlyDOIT_CONFIGin the dodo file reachedparams, becauseexecute()merges it wholesale.DoitCmdBase.executenow registers a config-supplieddefault_tasksas a default value before mergingDOIT_CONFIG, which keeps the existing precedence (DOIT_CONFIGwins, as it does for regular options).Tests: 4 new tests in
tests/test_cmd_forget.py— unit tests for the no-selection case (plain and--follow-sub) and end-to-end tests throughDoitMainfor both issues. All 4 fail on the unmodified code. Full suite: 839 passed, with the same single pre-existing environment failure as on master (tests/test___main__.py::TestMain::test_execute, also failing without this change).