Skip to content

Commit

Permalink
Fix undocumented value (#7)
Browse files Browse the repository at this point in the history
* fixes #6
* update verison
* prepare ppa release
  • Loading branch information
psycofdj authored Jul 2, 2018
1 parent ce7e153 commit 365d46d
Show file tree
Hide file tree
Showing 5 changed files with 29 additions and 8 deletions.
6 changes: 4 additions & 2 deletions .travis.yml
Original file line number Diff line number Diff line change
Expand Up @@ -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
Expand Down
9 changes: 5 additions & 4 deletions coverxygen/__init__.py
Original file line number Diff line number Diff line change
Expand Up @@ -10,7 +10,7 @@

__author__ = "Xavier MARCELET <[email protected]>"
__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__
Expand Down Expand Up @@ -86,14 +86,15 @@ 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):
for c_key in ["briefdescription", "detaileddescription", "inbodydescription"]:
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

Expand Down Expand Up @@ -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:
Expand Down Expand Up @@ -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")

Expand Down
12 changes: 12 additions & 0 deletions debian/changelog
Original file line number Diff line number Diff line change
@@ -1,3 +1,15 @@
coverxygen (1.3.1ppa1~xenial) xenial; urgency=medium

* fix generated value when item is undocumented

-- Xavier MARCELET <[email protected]> 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 <[email protected]> Mon, 02 Jul 2018 13:26:17 +0200

coverxygen (1.3.0ppa1~xenial) xenial; urgency=medium

* strengthen and sanitize code
Expand Down
2 changes: 1 addition & 1 deletion devtools/statuses.py
Original file line number Diff line number Diff line change
Expand Up @@ -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")
Expand Down
8 changes: 7 additions & 1 deletion devtools/xtdlint.py
Original file line number Diff line number Diff line change
Expand Up @@ -7,6 +7,8 @@

#------------------------------------------------------------------#



import os
import sys
import pylint
Expand Down Expand Up @@ -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" : {
Expand Down Expand Up @@ -103,7 +109,7 @@ def _display(self, layout):
"errors" : self._getStats()
},
"errors" : self.m_data
}))
}), file=self.out)


class XtdLint(PyLinter):
Expand Down

2 comments on commit 365d46d

@psycofdj
Copy link
Owner Author

Choose a reason for hiding this comment

The reason will be displayed to describe this comment to others. Learn more.

Automatic build report for commit 365d46d:

Unit Tests
PyLint

@psycofdj
Copy link
Owner Author

Choose a reason for hiding this comment

The reason will be displayed to describe this comment to others. Learn more.

Automatic build report for commit 365d46d:

Unit Tests
PyLint

Please sign in to comment.