#184 Spurious check in report
Closed: Fixed Opened by misc.

When running with devel, i see the following :
{{{

[ ]: Package contains systemd file(s) if in need.

[ ]: Large documentation must go in a -doc subpackage.
Note: Documentation size is 10240 bytes in 2 files.

}}}

That's because GenericShouldCheckbase is run, and by default, the run method will just print "N/A". I tried to fix it with the following patch :

{{{
commit a93e305a28b9d31819c8964d17e2e3ae0207589c
Author: Michael Scherer misc@zarb.org
Date: Sat Dec 15 20:20:56 2012 +0100

disable spurious empty check from appearing in the final report

diff --git a/plugins/generic.py b/plugins/generic.py
index 073c49f..97bde1c 100644
--- a/plugins/generic.py
+++ b/plugins/generic.py
@@ -66,6 +66,8 @@ class GenericMustCheckbase(CheckBase):
def init(self, checks):
CheckBase.init(self, checks, file)

  • def run(self):
  • self.set_passed(None)

class CheckApprovedLicense(GenericMustCheckbase):
'''
diff --git a/plugins/generic_should.py b/plugins/generic_should.py
index 764919c..067733b 100644
--- a/plugins/generic_should.py
+++ b/plugins/generic_should.py
@@ -51,6 +51,9 @@ class GenericShouldCheckbase(CheckBase):
def init(self, checks):
CheckBase.init(self, checks, file)

  • def run(self):
  • self.set_passed(None)
    +

class CheckBuildInMock(GenericShouldCheckbase):
'''
}}}

But then, half of the report disappeared.

So the question is : "how do we disable those check".

I have a few idea :
- hardcode the name of the checks to remove
- make sure every final check has a proper run method
- filter check based on the presence of a text attribute

I am leaning on the 3rd proposal ( 1st duplicate information, 2nd is too much work and go against the idea of inheritance ), but I would be sure to have the input on others on the fix.


I have a fourth proposal: use existing name magic. The Registry will skip all tests with a name ending in 'Base' (as well as anyone without a 'Check' in the name). It's just that I used 'base' instead of 'Base'. Will fix.

Fixed in 1594a5f29e6cd9.

Using the name magic is natural, is it's an old relic from the first versions which is used in all plugins. That is not to say this is a ideal solution.... (I think I'd prefer filtering based on an attribute).

Sorry for the mess.

Metadata