This repository was archived by the owner on Jan 14, 2024. It is now read-only.
File tree Expand file tree Collapse file tree 2 files changed +17
-2
lines changed Expand file tree Collapse file tree 2 files changed +17
-2
lines changed Original file line number Diff line number Diff line change @@ -98,8 +98,11 @@ def execute(self, context: ExecutionContext) -> bool:
98
98
group_name = declaration .get_group_name ()
99
99
100
100
# (optional) whitelists of displayed groups
101
- if whitelisted_groups and (':' + group_name ) not in whitelisted_groups :
102
- continue
101
+ if whitelisted_groups :
102
+ group_to_whitelist_check = (':' + group_name ) if group_name else '' # allow empty group ([global])
103
+
104
+ if group_to_whitelist_check not in whitelisted_groups :
105
+ continue
103
106
104
107
if group_name not in groups :
105
108
groups [group_name ] = {}
Original file line number Diff line number Diff line change @@ -165,6 +165,18 @@ def test_tasks_whitelist_shows_only_selected_groups(self):
165
165
self .assertIn (':rkd:create-structure' , full_output )
166
166
self .assertNotIn (':exec' , full_output )
167
167
168
+ def test_task_whitelist_shows_only_global_group (self ):
169
+ """Test that when we set RKD_WHITELIST_GROUPS=,, then we will see only tasks from [global] group"""
170
+
171
+ try :
172
+ os .environ ['RKD_WHITELIST_GROUPS' ] = ','
173
+ full_output , exit_code = self ._run_and_capture_output ([':tasks' ])
174
+ finally :
175
+ os .environ ['RKD_WHITELIST_GROUPS' ] = ''
176
+
177
+ self .assertIn (':tasks' , full_output )
178
+ self .assertNotIn (':rkd:create-structure' , full_output )
179
+
168
180
def test_task_alias_resolves_task (self ):
169
181
"""Test that with RKD_ALIAS_GROUPS=":py->:class-war" the :class-war:build would be resolved to :py:build"""
170
182
You can’t perform that action at this time.
0 commit comments