Skip to content

Commit 56da609

Browse files
committed
- add warnings for running tasks which do not exist (catch typos) and when no files were matched in a files task job
1 parent 3df44aa commit 56da609

File tree

1 file changed

+11
-0
lines changed

1 file changed

+11
-0
lines changed

scripts/pmbuild.py

Lines changed: 11 additions & 0 deletions
Original file line numberDiff line numberDiff line change
@@ -691,6 +691,8 @@ def get_task_files(config, task_name):
691691
stripped.append((changed, output[1]))
692692
pairs = stripped
693693
pairs = filter_files(config, task_name, pairs)
694+
if len(pairs) == 0:
695+
print_warning(f"[warning] no files were matched for this task: {files_array}")
694696
return pairs
695697

696698

@@ -1321,6 +1323,15 @@ def core_help(config, taskname, task_type):
13211323
def generate_build_order(config, config_all, all):
13221324
# filter tasks
13231325
runnable = []
1326+
1327+
# check for typos
1328+
for task in sys.argv[2:]:
1329+
if not task.startswith("-n"):
1330+
task = task.strip("-")
1331+
if task not in config:
1332+
print_warning(f"[warning] task '{task}' not found in config")
1333+
1334+
# add runnable tasks
13241335
for task_name in config.keys():
13251336
task = config[task_name]
13261337
if type(task) != dict:

0 commit comments

Comments
 (0)