diff --git a/.travis.yml b/.travis.yml index 8bf44f7..5d756b9 100644 --- a/.travis.yml +++ b/.travis.yml @@ -4,12 +4,14 @@ cache: - pip install: - - sudo apt-get install graphviz debhelper python-all python-setuptools python3-all python3-setuptools python3-pip lintian + - sudo apt-get install graphviz debhelper python-all python-setuptools python3-all python3-setuptools python3-pip lintian fakeroot + script: - export PATH=/usr/bin:${PATH} - sudo -H python3 -m pip install --upgrade pip - - sudo -H python3 -m pip install -rrequirements.dev.txt --upgrade + - sudo -H python3 -m pip install --ignore-installed six urllib3 + - sudo -H python3 -m pip install --ignore-installed -rrequirements.dev.txt --upgrade - python3 ./devtools/statuses.py --commit=${TRAVIS_COMMIT} --build-id=${TRAVIS_BUILD_ID} --token=${token} --pull-id=${TRAVIS_PULL_REQUEST} - ./devtools/coverage.sh python3 - dpkg-buildpackage -uc -us diff --git a/coverxygen/__init__.py b/coverxygen/__init__.py index b74b212..c3f00e2 100644 --- a/coverxygen/__init__.py +++ b/coverxygen/__init__.py @@ -10,7 +10,7 @@ __author__ = "Xavier MARCELET " __copyright__ = "Copyright (C) 2016 Xavier MARCELET" -__version__ = "1.3.0" +__version__ = "1.3.1" __description__ = "Generate doxygen's documentation coverage report" __url__ = "https://github.com/psycofdj/coverxygen" __download_url__ = "https://github.com/psycofdj/coverxygen/tarball/%s" % __version__ @@ -86,6 +86,7 @@ def extract_name(p_node): elif l_id is not None : return l_id Coverxygen.error("unable to deduce name from node %s", ET.tostring(p_node)) + return None @staticmethod def extract_documented(p_node): @@ -93,7 +94,7 @@ def extract_documented(p_node): l_node = p_node.find("./%s" % c_key) if l_node is not None: l_content = "".join(l_node.itertext()).strip() - if len(l_content): + if l_content: return True return False @@ -145,7 +146,7 @@ def process_symbol(self, p_node, p_filePath): @staticmethod def merge_symbols(p_results, p_symbols): for c_symbol in p_symbols: - if not len(c_symbol): + if not c_symbol: continue l_file = c_symbol["file"] if not l_file in p_results: @@ -223,7 +224,7 @@ def output_print_lcov(p_stream, p_results): for c_item in c_data: l_value = 1 if not c_item["documented"]: - l_value = -1 + l_value = 0 p_stream.write("DA:%d,%d\n" % (c_item["line"], l_value)) p_stream.write("end_of_record\n") diff --git a/debian/changelog b/debian/changelog index d9eb395..bfb1df9 100644 --- a/debian/changelog +++ b/debian/changelog @@ -1,3 +1,15 @@ +coverxygen (1.3.1ppa1~xenial) xenial; urgency=medium + + * fix generated value when item is undocumented + + -- Xavier MARCELET Mon, 02 Jul 2018 13:26:17 +0200 + +coverxygen (1.3.1ppa1~trusty) xenial; urgency=medium + + * fix generated value when item is undocumented + + -- Xavier MARCELET Mon, 02 Jul 2018 13:26:17 +0200 + coverxygen (1.3.0ppa1~xenial) xenial; urgency=medium * strengthen and sanitize code diff --git a/devtools/statuses.py b/devtools/statuses.py index a725c7c..e30a9af 100755 --- a/devtools/statuses.py +++ b/devtools/statuses.py @@ -212,7 +212,7 @@ def run_pylint(self): print("Running pylint ") print("-------------------") - l_proc = subprocess.Popen(["python3", "./devtools/xtdlint.py", "--rcfile", ".pylintrc", "-j", "4", "coverxygen" ], stdout=subprocess.PIPE) + l_proc = subprocess.Popen(["python3", "./devtools/xtdlint.py", "--rcfile", ".pylintrc", "-j", "4", "coverxygen", "-r", "yes", "-s", "yes" ], stdout=subprocess.PIPE) l_proc.wait() try: l_lines = l_proc.stdout.read().decode("utf-8") diff --git a/devtools/xtdlint.py b/devtools/xtdlint.py index e3adef9..93291f1 100755 --- a/devtools/xtdlint.py +++ b/devtools/xtdlint.py @@ -7,6 +7,8 @@ #------------------------------------------------------------------# + + import os import sys import pylint @@ -75,6 +77,10 @@ def _getStats(self): def _display(self, layout): + """Don't do nothing.""" + + def display_messages(self, layout): + self.m_linter._report_evaluation() print(json.dumps({ "report" : { "cloc" : { @@ -103,7 +109,7 @@ def _display(self, layout): "errors" : self._getStats() }, "errors" : self.m_data - })) + }), file=self.out) class XtdLint(PyLinter):