[Pkg-debile-commits] [debile-slave] 21/100: add adequate

Sylvestre Ledru sylvestre at alioth.debian.org
Mon Aug 19 14:53:01 UTC 2013


This is an automated email from the git hooks/post-receive script.

sylvestre pushed a commit to branch master
in repository debile-slave.

commit 67c0de422c94a0f763fa6074b60549a8bdf45662
Author: Paul Tagliamonte <tag at pault.ag>
Date:   Sat May 25 10:37:32 2013 -0400

    add adequate
---
 ethel/wrappers/adequate.py      |   27 +++++++++++++++++++++++++++
 tests/wrappers/test_adequate.py |   30 ++++++++++++++++++++++++++++++
 2 files changed, 57 insertions(+)

diff --git a/ethel/wrappers/adequate.py b/ethel/wrappers/adequate.py
new file mode 100644
index 0000000..3436348
--- /dev/null
+++ b/ethel/wrappers/adequate.py
@@ -0,0 +1,27 @@
+from firehose.model import Issue, Message, File, Location
+import re
+
+OUTPUT_REGEX = re.compile(r"(?P<package>.*): (?P<tag>[^\s]*) (?P<info>.*)")
+
+
+def parse_adequate(lines):
+    for line in lines:
+        info = OUTPUT_REGEX.match(line).groupdict()
+
+        testid = info['tag']
+        severity = "error"
+        pth = info['info'].split(" ", 1)
+        pth = pth[0] if pth else None
+
+        if pth is None:
+            continue
+
+        yield Issue(cwe=None,
+                    testid=testid,
+                    location=Location(file=File(pth, None),
+                                      function=None,
+                                      point=None),
+                    severity=severity,
+                    message=Message(text=line),
+                    notes=None,
+                    trace=None)
diff --git a/tests/wrappers/test_adequate.py b/tests/wrappers/test_adequate.py
new file mode 100644
index 0000000..a02a433
--- /dev/null
+++ b/tests/wrappers/test_adequate.py
@@ -0,0 +1,30 @@
+from ethel.wrappers.adequate import parse_adequate
+
+
+TESTS = [
+    ("python-support: broken-symlink /usr/lib/python2.6/dist-packages/python"
+     "-support.pth -> ../../pymodules/python2.6/.path",
+        "broken-symlink"),
+
+    ("python2.7-minimal: obsolete-conffile /etc/python2.7/sitecustomize.py",
+        "obsolete-conffile"),
+
+    ("python3-debian: py-file-not-bytecompiled "
+        "/usr/lib/python3/dist-packages/debian/debtags.py",
+     "py-file-not-bytecompiled"),
+
+    ("iputils-ping: bin-or-sbin-binary-requires-usr-lib-library "
+        "/bin/ping6 => /usr/lib/x86_64-linux-gnu/libtasn1.so.6",
+     "bin-or-sbin-binary-requires-usr-lib-library"),
+
+    ("libkml0: undefined-symbol /usr/lib/libkmlconvenience.so.0.0.0 => _ZN9"
+        "kmlengine20ComputeFeatureLookAtERKN5boost13intrusive_pt"
+        "rIN6kmldom7FeatureEEE",
+    "undefined-symbol"),
+]
+
+
+def test_adequate():
+    for string, testid in TESTS:
+        issue = next(parse_adequate([string]))
+        assert issue.testid == testid

-- 
Alioth's /usr/local/bin/git-commit-notice on /srv/git.debian.org/git/pkg-debile/debile-slave.git



More information about the Pkg-debile-commits mailing list