Skip to content

Commit

Permalink
fix: more informative nothing to be done message (#1234)
Browse files Browse the repository at this point in the history
* fix: more informative nothing to be done message

* fmt
  • Loading branch information
johanneskoester committed Oct 26, 2021
1 parent cfd2f89 commit 368d265
Show file tree
Hide file tree
Showing 2 changed files with 9 additions and 3 deletions.
3 changes: 3 additions & 0 deletions snakemake/common/__init__.py
Expand Up @@ -25,6 +25,9 @@
DYNAMIC_FILL = "__snakemake_dynamic__"
SNAKEMAKE_SEARCHPATH = str(Path(__file__).parent.parent.parent)
UUID_NAMESPACE = uuid.uuid5(uuid.NAMESPACE_URL, "https://snakemake.readthedocs.io")
NOTHING_TO_BE_DONE_MSG = (
"Nothing to be done (all requested files are present and up to date)."
)

ON_WINDOWS = platform.system() == "Windows"

Expand Down
9 changes: 6 additions & 3 deletions snakemake/workflow.py
Expand Up @@ -73,6 +73,7 @@
Scatter,
Gather,
smart_join,
NOTHING_TO_BE_DONE_MSG,
)
from snakemake.utils import simplify_path
from snakemake.checkpoints import Checkpoint, Checkpoints
Expand Down Expand Up @@ -820,7 +821,9 @@ def files(items):
)
else:
logger.info(
"Subworkflow {}: Nothing to be done.".format(subworkflow.name)
"Subworkflow {}: {}".format(
subworkflow.name, NOTHING_TO_BE_DONE_MSG
)
)
if self.subworkflows:
logger.info("Executing main workflow.")
Expand Down Expand Up @@ -1051,13 +1054,13 @@ def files(items):
if self.mode == Mode.default:
logger.run_info("\n".join(dag.stats()))
else:
logger.info("Nothing to be done.")
logger.info(NOTHING_TO_BE_DONE_MSG)
else:
# the dryrun case
if len(dag):
logger.run_info("\n".join(dag.stats()))
else:
logger.info("Nothing to be done.")
logger.info(NOTHING_TO_BE_DONE_MSG)
return True
if quiet:
# in case of dryrun and quiet, just print above info and exit
Expand Down

0 comments on commit 368d265

Please sign in to comment.