From 12534d8202ad1c3bdea0a8dd6f99b538f6c03510 Mon Sep 17 00:00:00 2001 From: "Salvador E. Tropea" Date: Tue, 1 Sep 2020 20:29:49 -0300 Subject: [PATCH] Added new filter criteria: exclude ref == '#*' --- kibot/fil_generic.py | 5 +++++ 1 file changed, 5 insertions(+) diff --git a/kibot/fil_generic.py b/kibot/fil_generic.py index 9d6a2fef..b6feb68a 100644 --- a/kibot/fil_generic.py +++ b/kibot/fil_generic.py @@ -64,6 +64,8 @@ class Generic(BaseFilter): # noqa: F821 self.exclude_refs = Optionable """ [list(string)] List of references to be excluded. Use R* for all references with R prefix """ + self.exclude_all_hash_ref = False + """ Exclude all components with a reference starting with # """ # Skip virtual components if needed # TODO: We currently lack this information # if config.blacklist_virtual and m.attr == 'Virtual': @@ -146,6 +148,9 @@ class Generic(BaseFilter): # noqa: F821 # Exclude components with empty 'Value' if self.exclude_empty_val and (value == '' or value == '~'): return exclude + # Exclude all ref == #* + if self.exclude_all_hash_ref and comp.ref[0] == '#': + return exclude # List of references to be excluded if self.exclude_refs and (comp.ref in self.exclude_refs or comp.ref_prefix+'*' in self.exclude_refs): return exclude