query: drop query.supports_dts_comp() getter method

Signed-off-by: Théo Lebrun <theo.lebrun@bootlin.com>
This commit is contained in:
Théo Lebrun 2025-03-07 16:14:45 +01:00
parent e1fecd1c3f
commit c0c5d2283c
4 changed files with 3 additions and 7 deletions

View file

@ -13,7 +13,7 @@ class DtsCompCodeFilter(Filter):
def check_if_applies(self, ctx) -> bool: def check_if_applies(self, ctx) -> bool:
return super().check_if_applies(ctx) and \ return super().check_if_applies(ctx) and \
ctx.query.supports_dts_comp() and \ ctx.query.dts_comp_support and \
extension_matches(ctx.filepath, {'c', 'cc', 'cpp', 'c++', 'cxx', 'h', 's'}) extension_matches(ctx.filepath, {'c', 'cc', 'cpp', 'c++', 'cxx', 'h', 's'})
def transform_raw_code(self, ctx, code: str) -> str: def transform_raw_code(self, ctx, code: str) -> str:

View file

@ -13,7 +13,7 @@ class DtsCompDocsFilter(Filter):
def check_if_applies(self, ctx) -> bool: def check_if_applies(self, ctx) -> bool:
return super().check_if_applies(ctx) and \ return super().check_if_applies(ctx) and \
ctx.query.supports_dts_comp() and \ ctx.query.dts_comp_support and \
ctx.filepath.startswith('/Documentation/devicetree/bindings') ctx.filepath.startswith('/Documentation/devicetree/bindings')
def transform_raw_code(self, ctx, code: str) -> str: def transform_raw_code(self, ctx, code: str) -> str:

View file

@ -11,7 +11,7 @@ class DtsCompDtsFilter(Filter):
def check_if_applies(self, ctx) -> bool: def check_if_applies(self, ctx) -> bool:
return super().check_if_applies(ctx) and \ return super().check_if_applies(ctx) and \
ctx.query.supports_dts_comp() and \ ctx.query.dts_comp_support and \
extension_matches(ctx.filepath, {'dts', 'dtsi'}) extension_matches(ctx.filepath, {'dts', 'dtsi'})
def transform_raw_code(self, ctx, code: str) -> str: def transform_raw_code(self, ctx, code: str) -> str:

View file

@ -79,10 +79,6 @@ class Query:
def close(self): def close(self):
self.db.close() self.db.close()
# Get state of dts_comp_support
def supports_dts_comp(self):
return self.dts_comp_support
# Check if a dts compatible string exists # Check if a dts compatible string exists
def dts_comp_exists(self, ident): def dts_comp_exists(self, ident):
if self.dts_comp_support: if self.dts_comp_support: