[gi-docgen/check-ignore: 1/6] config: Add a condition for skipped symbols during check
- From: Emmanuele Bassi <ebassi src gnome org>
- To: commits-list gnome org
- Cc:
- Subject: [gi-docgen/check-ignore: 1/6] config: Add a condition for skipped symbols during check
- Date: Fri, 11 Jun 2021 12:52:39 +0000 (UTC)
commit 9876959b42649fa7036a48e4ded148676faf974d
Author: Emmanuele Bassi <ebassi gnome org>
Date: Fri Jun 11 13:34:49 2021 +0100
config: Add a condition for skipped symbols during check
We want to skip hidden symbols, but we also want to ignore some
documented symbol specifically.
gidocgen/config.py | 14 +++++++++++---
1 file changed, 11 insertions(+), 3 deletions(-)
---
diff --git a/gidocgen/config.py b/gidocgen/config.py
index 5647d64..3da1709 100644
--- a/gidocgen/config.py
+++ b/gidocgen/config.py
@@ -155,7 +155,7 @@ class GIDocConfig:
def objects(self):
return self._config.get('object', {})
- def is_hidden(self, name, category=None, key=None):
+ def match_object(self, name, match_key, category=None, key=None):
def obj_matches(obj, name):
n = obj.get('name')
p = obj.get('pattern')
@@ -167,7 +167,7 @@ class GIDocConfig:
for obj in self.objects:
if obj_matches(obj, name):
if category is None:
- return obj.get('hidden', False)
+ return obj.get(match_key, False)
else:
assert key is not None
obj_category = obj.get(category)
@@ -175,9 +175,17 @@ class GIDocConfig:
return False
for c in obj_category:
if obj_matches(c, key):
- return c.get('hidden', False)
+ return c.get(match_key, False)
return False
+ def is_hidden(self, name, category=None, key=None):
+ return self.match_object(name, 'hidden', category, key)
+
+ def is_skipped(self, name, category=None, key=None):
+ if self.is_hidden(name, category, key):
+ return True
+ return self.match_object(name, 'check_ignore', category, key)
+
class GITemplateConfig:
"""Load and represent the template configuration"""
[
Date Prev][
Date Next] [
Thread Prev][
Thread Next]
[
Thread Index]
[
Date Index]
[
Author Index]